-2
我定义为C#代码的对象如下:如何将C#类对象传递给C++非托管代码?
class CSObject
{
int length;
int width;
IList<SubItem> Items;
bool OnSale;
ItemType type; //ItemType is an enum
}
Class SubItem
{
object AssociatedValue;
List<Range> Highlight; // Range is another class represents a pair (0, 4)
string Name;
IList<SubItem> Items;
string Title;
}
现在,我们如何把这个在C++代码的方法?
- 我是否需要在C++端创建类似的类并发送这些数据并在那里进行derseialize?
- 我不需要修改C++端的对象,只需要遍历它。
你可以找到答案[这里](https://msdn.microsoft.com/ EN-US /库/ eshywdt7(v = vs.110)的.aspx)。 – dymanoid