我需要C#里面用VC编的Dll库,现在存在两个问题:
1、在DLL里面有个未定义的结构体,
例如:typedef struct command *com;
我在C# 转换时,定义为using com = System.Intptr;
可以吗?
如果VC内的接口函数为IMPORT_EXPORT bool function(const com handle);
我在C#内转换为 [DllImport("plusdll.dll")]
public static extern bool function(com handle);是否正确?
最后调用时用:com handle=new com() ;
TR_OpenAccount(handle);是否正确?2、还有C#怎么转换VC函数参数为指针的指针情况?比如:IMPORT_EXPORT TR_CMDRESULT function(WORD** results,DWORD* number);
1、在DLL里面有个未定义的结构体,
例如:typedef struct command *com;
我在C# 转换时,定义为using com = System.Intptr;
可以吗?
如果VC内的接口函数为IMPORT_EXPORT bool function(const com handle);
我在C#内转换为 [DllImport("plusdll.dll")]
public static extern bool function(com handle);是否正确?
最后调用时用:com handle=new com() ;
TR_OpenAccount(handle);是否正确?2、还有C#怎么转换VC函数参数为指针的指针情况?比如:IMPORT_EXPORT TR_CMDRESULT function(WORD** results,DWORD* number);
2、** 方式可以用ref IntPtr;