C++中原型是怎样的:
extern "C" _declspec(dllexport) void * creat(const char* password);
整个怎么在C# 中调用啊,void * 正常对应的是 IntPtr,可总是说签名不正确,byte[]也不行
黄舟2017-04-17 11:10:42
You should post the question code first.
I think it may be that CallingConvention
is not specified:
[DllImport("???.dll", EntryPoint = "creat", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.SysInt)]
public static extern IntPtr Create(...);
怪我咯2017-04-17 11:10:42
Incorrect signature? Are you sure it's not because your dll is 32-bit and your system is 64-bit?