All ports from COM1 to COM9 will have no problem when being opened with Turbo C++ or Visual C++ that uses Win32 API (~from my understanding). Any attempt to open COM greater than COM10 will resulted an error.
By asking Google Sensei, a found a suggestion to the problem and try it out. And it was so great that I managed to solve the problem by tweaking here and there and a little effort of try and error method.
The suggestion to use "\\.\COM10" will not work in Turbo C++ as advised however "\\\\.\\COM10" perfectly worked!!
The codes below is being used in my serial communication class;
// Check if COM10 & aboveハッピー
AnsiString tempPort;
int i = portName.Length();
if(isdigit(portName[i-1])) {
tempPort.sprintf("\\\\.\\%s", portName);
portName = tempPort;
}
No comments:
Post a Comment