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[]);