我正在尝试从 VB6 应用程序调用用 C++ 编写的 DLL。
这是调用 DLL 的 C++ 示例代码。
char firmware[32];
int maxUnits = InitPowerDevice(firmware);
但是,当我尝试从 VB6 调用它时,我得到了错误bad DLL calling convention
。
Public Declare Function InitPowerDevice Lib "PwrDeviceDll.dll" (ByRef firmware() As Byte) As Long
Dim firmware(32) As Byte
InitPowerDevice(firmware)
编辑:C++ 原型:
Name: InitPowerDevice
Parameters: firmware: returns firmware version in ?.? format in a character string (major revision and minor revision)
Return: >0 if successful. Returns number of Power devices connected
CLASS_DECLSPEC int InitPowerDevice(char firmware[]);