Serial COM on MOXA cards when > COM9 and using Win32 API on NT
-
Hello, Friday afternoon, ... Thought I should post this question now: "How does a programmer open COM 10, 11 or higher" [ccode] HANDLE hCom = CreateFile(szPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL)); [/ccode] It fails when using szPort = "COM10" although I do have the COM Ports available. Anyone experience in this field? I am working on NT. The cards are MOXA CI-134/ISA and C168H/PCI. I know there is a limitation when working with standard Win32 COM lib on Win 3.11, but does it still apply to WinNT ?? I thought WinNT could handle up to 256 COM ports? Help!
-
Hello, Friday afternoon, ... Thought I should post this question now: "How does a programmer open COM 10, 11 or higher" [ccode] HANDLE hCom = CreateFile(szPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL)); [/ccode] It fails when using szPort = "COM10" although I do have the COM Ports available. Anyone experience in this field? I am working on NT. The cards are MOXA CI-134/ISA and C168H/PCI. I know there is a limitation when working with standard Win32 COM lib on Win 3.11, but does it still apply to WinNT ?? I thought WinNT could handle up to 256 COM ports? Help!
Problem solved: I did get a very usefull reply from Mr Miller from Manaware. --- NT can do up to 256. The card manufacturer has not set up the registry and the 'DosNames' for the devices correctly. There might be other names for those serial ports, but the "COM" file names need special aliases created in the registry. Some manufacturers fail to add those when they install or initially load the device driver. Use RegEdit and look for 'SerialPort' or 'Serial Port' and you might find their real names. So the answer to your quesitons is "Yes, you are right, and the card manufacturer still has some work to do on their device drivers." --- The problem was solved by using "\\.\COMxx" In stead of opening "COMxx" (where xx is is the number)