Home > Software engineering >  VS2010 MFC to write a serial port communication control method can be used
VS2010 MFC to write a serial port communication control method can be used

Time:09-15


Write a serial port, using the method of control before production of small software, customers to use to register first 6.0 controls, sometimes registration not yet
Feeling control method is not good,
So to find information on the Internet, see the other people made a small program, the study is a problem that

Other people have this class


Below is I, have no, how to add


CodePudding user response:

CSerialPort v1.03 - Serial Port Wrapper

CodePudding user response:

https://download.csdn.net/download/tajon1226/11102637
There are points directly under my example

No points will go to the website of
A serial port source url: https://blog.csdn.net/itas109/article/details/84282860

CodePudding user response:

Control is bad to use, and need to register, compatibility is poor

CodePudding user response:

The
reference 3 floor walk every step response:
control is bad to use, but also need to register, poor compatibility also

+ 1

CodePudding user response:

In the heart of the solution view corresponding. H. CPP file added

CodePudding user response:

reference 5 floor zgl7903 reply:
corresponding in solution view. H. CPP file added

Thank you for using your method, successfully added,
The error C2664: "CreateFileW" : parameters can not be 1 from the "char *" into "LPCWSTR
"The error C2664: "BuildCommDCBW" : parameters can not be 1 from the "char *" into "LPCWSTR
"Error C2664: "MessageBoxW" : parameters can not be 2 from "LPCSTR" into "LPCWSTR
"But compile these mistakes, others can compile program, the compilation of these mistakes, why I is serialport. The inside of the CPP
Serialport. CPP is just the same with others

CodePudding user response:

Do not use the UNICODE

CodePudding user response:

refer to 7th floor schlafenhamster response:
project do not use the UNICODE


Thank you, use what you have said method, solve the problem, thank you very much

CodePudding user response:

The most primitive, you can use OpenFile open the serial port, and then use the way to read and write a serial port to read and write files

CodePudding user response:

The string with _T () macro contains, can adapt to UNICODE and multibyte compile environment

CodePudding user response:

The most primitive, you can use CreateFile open serial port
"With flow control, serial port communication program. Rar"
https://download.csdn.net/download/schlafenhamster/4195462

CodePudding user response:

refer to the second floor walk every step response:

https://download.csdn.net/download/tajon1226/11102637There are points directly under my example

No points will go to the website of
A serial port source url: https://blog.csdn.net/itas109/article/details/84282860


Praise, suggest or using UNICODE, excellent versatility,

CodePudding user response:

refer to 12 floor redleafe reply:
Quote: refer to the second floor walk every step response:

https://download.csdn.net/download/tajon1226/11102637
There are points directly under my example

No points will go to the website of
A serial port source url: https://blog.csdn.net/itas109/article/details/84282860


Praise, suggest or using UNICODE, good commonality,


Yes, many software tools, maybe one day in China for foreigners, with Unicode save trouble,
  • Related