作者aagogo (水瓶阿哥哥)
看板C_Sharp
标题c++ DLL含有list容器,c#该如何引用?
时间Tue Oct 30 10:46:35 2012
大致的程式码如下
bcb DLL
#ifdef DLLAPI
#else
#define DLLAPI __declspec(dllimport)
#endif
typedef list<int> lInt;
DLLAPI bool getLineListByFileName(lInt &aLineNOList, char * chFileName);
{
....
}
c#
[DllImport("TestDll.dll")]
static extern bool getLineListByFileName(ref List<int> somethingList, string
chFileName);
不过这样改的情况下
会出现底下的错误讯息
「无法封送处理 'parameter #1': 无法封送处理泛型型别。」
请问该如何改才可以正常的使用
也有把List<int>改成LinkedList<int>,不过也是一样的结果
还是说遇到这样的只有无解了?
谢谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.120.188.59