How can having MS Visual C++ 2010, to consider that the signal on the port?

The question was asked: 7 years 11 months ago   views: 82

How can having MS Visual C++ 2010, to consider the signal received at the port (USB or COM interested in both)? Just read, just a binary signal. In Windows.

Asked: 06-09-2011 в 00:10:38
com and usb in General is different ports (unless included com emulation via usb). - 06-09-2011 в 00:21:53
Hmm, when all will realize that in C++, no ports, no disk drives, no color monitors, no sound and even no cursor. Operating system, available libraries and compilers do not forget to specify please. - 06-09-2011 в 00:28:28

Answers   2


USB books Egorova. To work with the ports through the CreateFile(), as the name it is necessary to specify specially designed file name for the port, the docks and see examples.

Answered: 06-09-2011 в 14:28:18

To read from the COM almost the same thing and read from a file. Plenty of examples: 1, 2, 3.

Read from USB is possible only through the driver. The USB devices may be many different interfaces, some of them implement the interface COM port.

Answered: 06-09-2011 в 01:29:58