Код: Выделить всё
//...
extern "C" DWORD WINAPI GetDllVersion(void);
extern "C" LPVOID WINAPI CreateInstance(const char \*DeviceName);
#pragma pack(1)
struct ILE440
{
virtual HANDLE WINAPI GetModuleHandle(void) = 0;
virtual bool WINAPI OpenLDevice(WORD VirtualSlot) = 0;
//other methods
}
//other structs
Код: Выделить всё
[DllImport("lusbapi.dll")]
public static extern IntPtr CreateLInstance(StringBuilder sb);
//---------------------------------------------
var instancePtr = CreateInstance(dn);
Код: Выделить всё
var intance = AAA(instancePtr);
var bbb = intance.OpenDevice(...);
Подробнее здесь: https://stackoverflow.com/questions/790 ... on-c-sharp