Hi, I have tried some code ejecting CD ROM drive and one of the functions is CreateFile, the first argument of it is filename. At first I passed in "F:" (my cd rom drive letter) only, and there was an error with error code of 21 (device is not ready), I rechecked the sample code and I should've passed in @"\\.\F:" so what is the string "\\.\F:"?
Your help would be highly appreciated! Thanks!
I'm not sure you can use CreateFile to write to a CD-ROM (people are still using those?). But "\\.\F:" doesn't make sense. "\\." would be the root of the current drive, probably "C:\", and "F:" would point to your F drive, but putting them together doesn't work (you'd be going to C:\F:\, which is invalid).
Not to mention the first "\" is escaped, and the second is not, so depending on whether the string is using an @ or not (i.e. @"\\.\F:") you could also be going to C:\\F: (a nameless directory, not allowed by Windows to my knowledge, then a drive inside that which is invalid), or the F is a control character (form feed I think?) which should be invalid in Windows paths as well.
So to summarize, it doesn't mean anything.
On the other hand, your error is probably popping up because you use CreateFile, and then give it a path to a drive. You need to give it a path to a file, e.g. "F:\\myfile.ext".
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)