Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C++ API プロトタイプがあります
void Func(int& size);
C# で P/Invoke に変換するにはどうすればよいですか?
私が知っていることから、私が使用する場合
public static extern Func(ref int size);
の場合、関数は値の代わりに int へのポインターを受け取ります。
(おっと...これはコメントではなく答えとして意味します)。
また、C++ から呼び出すと、関数はポインターも受け取ります。参照は他にどのように実装されていると思いますか? Func() はそのポインターを参照として扱うため、そこに到達する方法は重要ではありません。