我也一知半解。试试
foxtable 中全局代码:
Public Declare Function OpenComPort Lib "UHFReader09.dll" (ByVal Port As Long, Byval ComAdr$, ByVal Baud As Byte, ByVal FrmHandle As Long) As Long
窗体按钮单击事件_打开端口事件为:(端口确定为com4)
‘打开端口代码
Dim Port As Long = 4 '设置端口号
Dim ComAdr As new String(ComAdr, 20) '全局变量广播地址
ComAdr = &HFF
Dim Baud As string = 5 '设置串口波特率
FrmHandle = -1 '置位,全局变量
fCmdRet = OpenComPort(Port, ComAdr, Baud, FrmHandle)