¡@

VxComm 013

back

 Q: How to open a virtual COM port that larger than "COM9" by calling CreateFile() Win32 API?

 Ans:
 For example: If you want to open "COM10", the correct way to call the CreateFile() is as follows:

 CreateFile(
   "\\\\. \\COM10", // address of name of the communications device
   fdwAccess,        // access (read-write) mode
   0,                     //  share mode
   NULL,             // address of security descriptor
   OPEN_EXISTING,     // how to create
  
0,                     // file attributes
   NULL                // handle of file with attributes to copy
  );

 NOTES:
 1. This syntax also works for ports COM1 through COM9. See more... MS Q115831.
 2. Maximum COM port number for VxComm Driver is COM256.
 3. Valid COM port number for MSCOMM.OCX is between 1 to 16. Please refer to MSComm.CommPort.

 
               

back

Written by Gary Lin 

Date:2004/9/7