-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