LoginSignup
0
0

More than 5 years have passed since last update.

CSharp > link > Marshalling – what is it and why do we need it? | managed | unmanaged

Last updated at Posted at 2017-06-20
動作環境
Windows 7 Pro (32bit)
Microsoft Visual Studio 2017 Community

Windows Forms Applicationのコードを見ていてMarshal.Copy()という処理を初めて知った。

IntPtr型の変数からbyte[]型の変数にMarshal.Copy()している。

同じ処理のC++ Builder実装ではこういうことは行っていない。

C#特有の処理のようだ。

以下に関連しそうな情報が見つかった。
Marshalling – what is it and why do we need it?

  • managed : managed by CLR
  • unmanaged : C, C++, assemblerなどで書かれたコード

SDKのAPIで得たデータをC#で使えるようにするためにMarshallingしているようだ。

SDKのAPIはC#だけでなく、C++にも対応するように用意されている。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0