动态链接库EasyUSB23xx.dll调用问题
EasyUSB23xx.dll文件中的两个函数定义如下:
int __stdcall ReadData23xx(int pipenum,unsigned char *recbuffer,int len,int waittime=-1);
int __stdcall WriteData23xx(int pipenum,unsigned char *sendbuffer,int len,int waittime=-1);
我用VB6.0时调用函数发出的数据不对,
申明:
Public Declare Function ReadData23xx Lib "EasyUSB23xx.dll" (ByVal pipenum As Long, ByRef bytRecvBuf() As Byte, _
ByVal len1 As Long, ByVal waittime As Long) As Long
Public Declare Function WriteData23xx Lib "EasyUSB23xx.dll" (ByVal pipenum As Long, ByRef bytSendBuf() As Byte, _
ByVal len1 As Long, ByVal waittime As Long) As Long
使用:
Dim intRet As Integer
Dim i As Long
Dim intLen As Integer
Dim bytSendBuf(1 To 200) As Byte
Dim bytRecvBuf(1 To 200) As Byte
Dim intSendNum As Integer
Dim strDis As String
intSendNum = 10
For i = 1 To intSendNum Step 1
bytSendBuf(i) = ((i - 1) Mod 100)
Next i
intRet = WriteData23xx(1, bytSendBuf, intSendNum, 1000)
If intRet <> intSendNum Then
MsgBox "发送错误!", vbExclamation
Exit Sub
End If
发现发出的数据乱七八糟的不对,我怀疑是申明的问题,大侠帮我看看怎么修改啊?
[解决办法]
你点“结贴”后,别人回复的每层楼,右上角那儿都有个小框,输入分数的。
反正不能把分给自己。
[解决办法]
哇哈哈哈哈,可怜的娃,这样的BUG都能遇到
[解决办法]
不是吧,我最近发的有个贴子,别人也贴代码了呢。
结贴时没发现有什么问题啊。
你把分给在6F也一样,嘿嘿……