Program | experience
Although I majored in computer science when I was in college, I think we all know the computer level of the undergraduates now. To the unit after a long time. But then slowly began to have some projects, the beginning is related to serial communication. Difficult point, but I am in the place is a can not easily say "no" place, had to bite the bullet began to dry, in order to keep pace with the times I chose vs.net2003 although the fact that the mature communication protocol with mature language (VC6,VB6) It might work better. But for better contact with a new generation of programming languages,,,,,,
Speaking of serial communication, nothing more than create file opened the serial port, write file to the serial port, read file from the serial port reading data. Combined with the specific equipment of the relevant data format can be programmed. I built the Vc.net,windows form project. Then the trouble began to appear. In the. NET form project, I like programming in VB, directly double-click the button and so on control, and then directly write the program in the Form1.h, can not function without function. Soon, the CreateFile function is not recognized, but in the programming window the system can recognize and give the corresponding function parameter hints. Check MSDN found that need #include , although Form1.cpp have, but also only in Form1.h and then include again, the result is that some things in the namespace can not be used, although some trouble, but still write the function in the. cpp file! , some serial devices will bring some implementation of their own functions of the. dll, needless to say, and can not be used, especially with C/COM, especially the underlying data formats and arrays, VB Module compatibility better, you can use vb.net two times encapsulation. The operation of the serial port itself is not complicated, but the problem is connected to the hardware after the need to spend a lot of mind to face the protection of the problem, the hardware will not be completely in accordance with the instructions to work!