求教C#调用c++ dll函数声明的问题
3m2u 2013-01-28 09:36:25 我知道在c#中一般通过dllimport引用其它dll中的函数。
但不知道一些类型如何在c#中申明。比如要传入的指针,传出的指针:
void* Init();
int Load(void *ptr, const char * szFileName);
如上的2个函数在c#中如何申明?
class xxclass
{
[ DllImport("xx.dll", EntryPoint = "Init", CharSet = CharSet.Auto)]
public static extern ??? Init();
[ DllImport("xx.dll", EntryPoint = "Load", CharSet = CharSet.Auto)],
public static extern int Load(??? ptr, byte[](???) szFileName);
}