This problem occurs during a serial communication. If COM1 to com9 is enabled normally and com10 or above is disabled, use getlasterror to check whether the specified file cannot be found for the error bit and then view msdn. The explanation is as follows:
Windows NT: You can use paths longer than max_path characters by calling the wide (w) version of createfile and prepending "\\? \ "To the path. "\\? \ "Tells the function to turn off path parsing. This lets you use paths that are nearly 32,000 Unicode
Characters long. however, each component in the path cannot be more than max_path characters long. you must use fully-qualified paths with this technique. this also works with UNC names. the "\\? \ "Is ignored as part of the path. For example ,"\\? \ C: \ myworld \ private"
Is seen as "C: \ myworld \ private", and "\\? \ UNC \ tom_1 \ hotstuff \ coolapps "is seen as" \ tom_1 \ hotstuff \ coolapps ".
When the path length is greater than max_path, add "\\? \ ", I guess, if the serial port is opened, only COM1 to com9 is supported. If the serial port is larger than 4 characters, it will not work. Therefore," \? "should be added to com10 or above "\\? \ ", That is
Createfile ("\\\\? \ Com10 ", generic_read | generic_write, 0, null, open_existing, file_flag_overlapped, 0 );
In this way, it can be opened successfully. All the above methods COM1 ~ 9 is also possible, so we suggest using this method.
Then you can see "\. \" on the Internet. You can try it and "\\? \ "Same, now I am thinking"?" What does it mean? Can it be changed to another symbol? I tried it later. I only needed to change it to ".". Please answer this question.