社区
VFP
帖子详情
usb hid设备数据读取方法
kqt007
2009-08-19 10:46:11
加精
试了很多,由于本的vfp水平有限,没有把别人的示例转换成vfp可用的,直接对hid.dll,setupapi.dll的调用也都有问题,所以请求高手们出手帮助。这里是一个别人做好的程序,希望能把vb的示例转成vfp的,或者有高手直接对原来的hid.dll,setupapi.dll进行封装。示例地址:http://d.download.csdn.net/down/1483288/inhaos。
...全文
3642
53
打赏
收藏
usb hid设备数据读取方法
试了很多,由于本的vfp水平有限,没有把别人的示例转换成vfp可用的,直接对hid.dll,setupapi.dll的调用也都有问题,所以请求高手们出手帮助。这里是一个别人做好的程序,希望能把vb的示例转成vfp的,或者有高手直接对原来的hid.dll,setupapi.dll进行封装。示例地址:http://d.download.csdn.net/down/1483288/inhaos。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
53 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zhaomwn
2012-01-06
打赏
举报
回复
这个dll是免费的吗?如果是共享版,是不是过一段时间就不能用了呀?
ericklin
2010-12-16
打赏
举报
回复
收入 很有幫助
cby666168
2009-08-26
打赏
举报
回复
看不懂
like_33833006
2009-08-25
打赏
举报
回复
up!~~~~~~~
mba999
2009-08-25
打赏
举报
回复
很深奧,不懂得呀!!
十豆三
2009-08-25
打赏
举报
回复
用木瓜的方法可以取出了,没想到这个 DLL 在 VFP 中使用这么麻烦。
dkfdtf 的方法还是不行。
木瓜应该是看了 VC 源程序而知道参数结构的。
fishba
2009-08-25
打赏
举报
回复
我也看不明白。不知道说什么。学习了。
hankanling123
2009-08-25
打赏
举报
回复
路过,帮顶
好
chenxiao2154
2009-08-25
打赏
举报
回复
貌似我也不明白也
chenxiao2154
2009-08-25
打赏
举报
回复
[Quote=引用 9 楼 kqt007 的回复:]
我现在的做法是这个样子,能不能看下是怎么回事,?dcnt要是能返回正确的值就好了
DECLARE long SetInstance in "UsbHidApi" long nval
?Setinstance(0)
返回0
Declare long GetList in "UsbHidApi.dll" long VendorID , long ProductID , string @Manufacturer , string @SerialNumber, string @DeviceName , string @DeviceList , long MaxDevices
VendorID=65535
ProductID=65535
Manufacturer=REPLICATE(CHR(0),100)
SerialNumber=REPLICATE(CHR(0),100)
DeviceName=REPLICATE(CHR(0),100)
DeviceList=REPLICATE(CHR(0),1000)
MaxDevices=10
dcnt = GetList(VendorID, ProductID, @Manufacturer, @SerialNumber, @DeviceName, @DeviceList,MaxDevices)
?dcnt
返回0
[/Quote]
queshi
lh6460
2009-08-25
打赏
举报
回复
hahA
lh6460
2009-08-25
打赏
举报
回复
试了,如果直接按你说的试的话,说是调用 dll 异常,修改为
? GetList(0xffff, 0xffff, '', '', '', @ m.pList, 20) 还是返回0
呵呵。不过还是谢谢,如果有设备你感觉好试吗?
terminal_t
2009-08-25
打赏
举报
回复
学习了
kqt007
2009-08-25
打赏
举报
回复
[Quote=引用 24 楼 apple_8180 的回复:]
用木瓜的方法可以取出了,没想到这个 DLL 在 VFP 中使用这么麻烦。
dkfdtf 的方法还是不行。
木瓜应该是看了 VC 源程序而知道参数结构的。
[/Quote]
我试的结果是木瓜和dkfdtf的方法都可以
昨天有事没上网,今天上来一看真是喜出望外啊
谢谢了!
结贴了!
24K純帥
2009-08-25
打赏
举报
回复
菜鸟帮顶~
feiren_1012
2009-08-25
打赏
举报
回复
学习
junbujian
2009-08-25
打赏
举报
回复
顶 。。。。。。。。。。。。。。。。。。。
shjejay00
2009-08-25
打赏
举报
回复
haha
lijing1211
2009-08-25
打赏
举报
回复
看了,谢谢楼主。
ljyit
2009-08-25
打赏
举报
回复
上面发贴错误,C接口需要的是mdeviceList2结构
加载更多回复(31)
C#
读取
USB
HID
设备
这是用C#写的
读取
USB
HID
设备
的测试软件,输入VID、PIV,查找
HID
设备
是否存在,如果存在,则
读取
指定的
HID
设备
发来的
数据
。软件已测试,可以直接使用。(不可
读取
键盘、鼠标),只能
读取
自定义
HID
设备
。
usb
hid
数据
读取
usb
hid
数据
读取
完整的demo
C++实现
USB
HID
设备
读写代码
C++实现
USB
HID
设备
读写代码,通过C++语言来实现
读取
usb
接口
设备
的
数据
读写。
qt 通过
hid
获取指定
usb
设备
并
读取
数据
文件夹中包含
hid
api.h
hid
api.dll
hid
api.lib,我是在windows10系统中用VS2013编译的release版本,我用于qt的调用,是可以实现的。 调用过程: int res; res =
hid
_init(); wchar_t wstr[MAX_STR]; int i; // Open the device using the VID, PID, // and optionally the Serial number. handle =
hid
_open(0x0483, 0x5750, NULL); if(handle == NULL) { qDebug() << "NULL-----------------------NULL" ; return; } else { qDebug() << " not ------------NULL-----------------------NULL" ; } // Read the Manufacturer String res =
hid
_get_manufacturer_string(handle, wstr, MAX_STR); wprintf(L"Manufacturer String: %s\n", wstr); // Read the Product String res =
hid
_get_product_string(handle, wstr, MAX_STR); wprintf(L"Product String: %s\n", wstr); // Read the Serial Number String res =
hid
_get_serial_number_string(handle, wstr, MAX_STR); wprintf(L"Serial Number String: (%d) %s\n", wstr[0], wstr); // Read Indexed String 1 res =
hid
_get_indexed_string(handle, 1, wstr, MAX_STR); wprintf(L"Indexed String 1: %s\n", wstr); qDebug("
hid
read start"); int res =
hid
_set_nonblocking(handle, 0); while (1) { res =
hid
_read(handle,buf,sizeof(buf)); QString asd ; for(int i = 0;i < sizeof(buf);i++) { char str[20]; sprintf(str , "%02x",buf[i]); asd+=str ; } if(!cardInfo.contains(asd.toUpper())) { cardInfo.append(asd.toUpper() ); for(int i = 0;i < cardInfo.size() ;i++) { dealWithData( cardInfo[i]); } } }
基于MFC编写的读写
USB
_
HID
设备
数据
程序(供参考学习)
本文档给了一个基于MFC来编写读写
USB
-
HID
设备
数据
的参考程序,详细介绍了编写思路,从宏观的角度实现了
HID
枚举成的
设备
与PC机建立通信的过程,大家可以参考学习。
VFP
2,723
社区成员
29,110
社区内容
发帖
与我相关
我的任务
VFP
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
复制链接
扫一扫
分享
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章