首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#调用VC6编写的dll,该如何解决

2012-03-17 
C#调用VC6编写的dllc++的dll中有这么一个导出方法:int RetrieveCamGroupListFromServer(int nServerID, li

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

热点排行