在mfc vc ++中将数据读取和写入USB端口 [英] reading and writing data to USB port in mfc vc++

查看:1456
本文介绍了在mfc vc ++中将数据读取和写入USB端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,专家,
昨晚在Google上度过了整个一整夜后,我发现没有什么东西可以解决我的问题.
所以我的最后选择就是你们所有人,
现在问题开始于何时,
我将基于窗口的应用程序从串行通信改进为用于硬件设备通信的USB通信.

当我从计算机上处​​理硬件时,我需要沟通才能进行.需要通过直接USB通讯来避免这种情况..
喜欢,
当我将USB笔式驱动器连接到PC时,我的软件会对其进行检测,并允许我在其上写入任何数据.

请提供任何接口,库,类或任何使用c ++或mfc的思想,以帮助我在USB PORT上读写数据.

谢谢.

Hi Experts,
After spending my whole last night on google i doesn''t found any thing useful to solve my problem.
so my last choice is all of you guys,
now problem start when,
I improves my window based application from serial communication to USB communication for hardware device communication.

When i deal with hardware from my pc .i need intermadiate for communication.need to avoid this with direct USB communication..
Like,
When i connect a USB pen drive to PC my software detect it and allows me to write any data on it.

please provide any interface, library , class or any think in c++ or mfc that helps me to read and write data on USB PORT.

Thanks.

推荐答案

首先,睡眠(有助于保持健康).

通常可以在USB上使用虚拟串行端口.如果您需要在笔式驱动器上写数据,我相信,到目前为止,更简单的方法是使用OS文件功能(您只需使用例如WMI [此处 [
First of all, sleep (it helps keeping you healthy).

Using virtual serial port on USB is often fine. If you need to write data on a pen drive the I believe the easier way is (by far) using OS file functions (you only need to detect when the pen drive is plugged in, using, for instance WMI[^]).

On the other hand, if you really need high speed communication with a USB device then, be warned, it wouldn''t be (as far as I know) a simple task (see for instance, here[^]).


这篇关于在mfc vc ++中将数据读取和写入USB端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆