我写了dll,其中一个函数是这样的:
可我在VB中调用时老出错
哪位大哥告诉我VB中正确的调用方法?谢谢了_declspec (dllexport) HANDLE WINAPI OpenByInterface(
GUID* pClassGuid, // points to the GUID that identifies the interface class
DWORD instance, // specifies which instance of the enumerated devices to open
PDWORD pError // address of variable to receive error status
)
{
HANDLE hDev;
CDeviceInterfaceClass DevClass(pClassGuid, pError);if (*pError != ERROR_SUCCESS)
return INVALID_HANDLE_VALUE;CDeviceInterface DevInterface(&DevClass, instance, pError);if (*pError != ERROR_SUCCESS)
return INVALID_HANDLE_VALUE;hDev = CreateFile(
DevInterface.DevicePath(),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);if (hDev == INVALID_HANDLE_VALUE)
*pError = GetLastError();return hDev;
}