尝试设置 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
我尝试将固件更改为字节数组、byref、字符串、整数、长整数等。它似乎不想运行。
有谁知道这个问题的解决方案?谢谢