日期:2014-05-18  浏览次数:20895 次

C#调用VC6编写的dll
c++的dll中有这么一个导出方法:int RetrieveCamGroupListFromServer(int nServerID, list<CAM_GROUP_INFO> *pCamGroupList); 参数list<CAM_GROUP_INFO> *pCamGroupList 写C#中应该怎么声明? list为标准模块库(stl)中的容器,CAM_GROUP_INFO是一个结构体。 在C#将此参数定义为List<CAM_GROUP_INFO>、LinkedList<CAM_GROUP_INFO>,运行时报无法封装泛型的参数。 哪位做过类似的,请给个提示。

------解决方案--------------------
不能直接用,因为C#不能理解"标准模块库list"。

换成类似这种导出:
int RetrieveCamGroupListFromServer(
int nServerID, 
CAM_GROUP_INFO *pCamGroupList,
int *groupListCount
);
------解决方案--------------------
不能直接调用的,我原来的 先声明一下就可以了
------解决方案--------------------
list是C++的,C#不认识,这是个c++特有的dll