C# 调用DLL动态库返回值的问题,请教~~~急!!!
c++里的函数
int GetInfo(long handle,unsigned char *tmp/*这个值要返回出来*/)
{
....................
retnum = classA->ReadData(tmp,1024);
}
int ClassA::ReadData(unsigned char* buffer/*void * buffer会报Invalid access to memory location错误*/, int limit )
{
...................
}
c#调用
[DllImport("CLib.dll", CharSet = CharSet.Ansi,EntryPoint = "GetInfo", CallingConvention = CallingConvention.Cdecl)]
public static extern int GetInfo(long handle,StringBuilder sb/*这里的值用ref,byte[] 都用过了,还不行*/)
请教~~~急!!!