dll调用
请问C#调用C++编写的DLL时,函数SI_Write (HANDLE Handle, LPVOID Buffer, DWORD NumBytesToWrite,DWORD *NumBytesWritten)应该怎样调用啊?我这样:[DllImport("SiUSBXp.dll", SetLastError = true, EntryPoint = "SI_Write", CharSet = CharSet.Ansi)]
public static extern int SI_Write(ref IntPtr hPrinter,ref byte[] pBuf, UInt32 cdBuf, ref UInt32 pcWritten);是不是不对的?
------解决方案--------------------
LPVOID ->IntPtr
你可能还需要Marshal的相关方法得到这个值