试图建立一个USB电源板。
这里的文档:
Initializes the Power USB API.
Name: InitPowerUSB
Parameters: model:returns the model number(1:basic, 2:digIO, 3:watchdog, 4:Smart), firmware: returns firmware version in ?.? format in a character string (major revision and minor revision)
Return: >0 if successful. Returns number of PowerUSB devices connected
C++ Example:
if (!m_pwrUSBInit)
{
int model; char firmware[8];
if ((ret=InitPowerUSB(&model, firmware)) > 0)
{
m_pwrUSBInit = 1;
m_numDevices = ret;
}
}
我一直在努力,没有运气得到这个工作与我的VB6代码,一个小时左右吧。 该方案要么崩溃,显示这样的错误Bad Calling Dll Convention
, type mismatch
,等等。
下面是我有:
Public Declare Function InitPowerUSB Lib "PwrUSBDll.dll" (ByRef model As Integer, ByVal firmware As String) As Integer
Dim model As Integer
model = 0
Dim firmware As String
firmware = ""
If (InitPowerUSB(model, firmware)) > 0) Then
EndIf
我试图改变固件字节数组,按地址,字符串,整数,长,等它只是似乎并不想运行。
有谁知道一个解决这个问题的? 谢谢