原本以為在 C# 中使用 struct 又要匯出成 .dll 給 c++ 需要有什麼特殊處理,結果發現其實不用...
namespace TESTCOMObject
{
//其他程式碼
//...
public struct tag_Data
{
public string strName;
public string strValue;
}
}
而在 C++ 裡頭要使用就只要 import 之後就可以放心用了
TESTCOMObject::tag_Data aa[50]; aa[7].strName = "xxabc"; aa[7].strValue = "oo"; aa[17].strName = "xxabcyy"; aa[17].strValue = "oo"; TESTCOMObject::tag_Data bb; bb.strName = "hahaha"; bb.strValue = "hehehe";