【发布时间】:2013-06-24 03:10:56
【问题描述】:
请考虑以下 C++/CLI 代码:
typedef unsigned __int8 uint8_t;
...
uint8_t unmanaged_buf[MAVLINK_MAX_PACKET_LEN];
array<uint8_t>^ Buffer;
...
Marshal::Copy((IntPtr)unmanaged_buf, Buffer, 0, len);
下面是使用的 Marshal::Copy() 方法吗?
Marshal::Copy Method (IntPtr, array<Byte>, Int32, Int32)
PS:上述方法的MSDN URL在:http://msdn.microsoft.com/en-us/library/ms146631.aspx
如果是,是不是因为Byte是最接近unsigned __int8的类型?具体来说,Visual C++ 编译器如何确定使用哪个方法重载?
【问题讨论】:
标签: c++-cli marshalling