A brief introduction to programming serial communication program based on API function under CB6

Source: Internet
Author: User

1-in C + + Builder 6.0 based on API functions to write serial communication program introduction:

In the Dos/win95/win98 era, the operating system of the serial port is not protected, that is, the serial port of the resources are fully open to users, users can use the direct operation of the hardware functions (such as TC2.0 under the InPort () and Outport () function) with the serial port directly deal with, At this time the user uses the direct Operation serial port function how "tortures" the serial port is no problem, the operating system does not ask at all, the operation of the serial port is caused by all the consequences are the user a person undertakes, at this time the user to the serial port has the high free control; Starting with the Win2000 operating system, Microsoft has implemented a hardware protection strategy to "take care of" the hardware on the computer, meaning that any user attempting to manipulate the serial port under his operating system must go through his consent to do so. In fact, that is to disguise the user must use his communication API function to operate the serial port of the "sheep path" on the drive (of course, there are other ways to operate the serial port, but those are not me and other ordinary users can study understand it, the image of a little like how you want to operate the serial port intent must undergo Win2000 translation ( In fact, Win2000 device driver can be conveyed to the serial port, on the basis of which we say (in fact, a lot of information is said) Win2000 under the API function to operate the serial port is "device-independent", what does it mean? How do you want to operate the serial port with the corresponding API function to tell the operating system you want to do to the serial port, and then the operating system to convey your meaning to the serial port to make the corresponding action, relative to the Dos/win95/win98, As far as I understand, it's equivalent to what you wrote. Direct operation of serial port functions under Win2000 He did it for you, but you have to use the Win2000 Communication API function to clearly express to the operating system what you want to do, So in this case to write a good serial port driver you must at least understand the Win2000 of the communication API functions are doing FANGCO, Shing nagging so much ... sorry, not yet, at least one more thing I want to say, is that in dos/win95/ Win98 system has a lot of experts with C/COM + + to direct the operation of the serial port is very skilled, especially the DOS era of the Turbo 2.0 operation serial port master they wrote the serial port driver until Win98 when still used very complacent, but when the Win2000, Their programs suddenly get out of the way, and some of them may still be confused by the knowledge structure lag, brothers, you know? Gossip less, the following describes the author of the serial communication functions used in the use of various API functions---------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.