createfile to open comm port...
I am writing a program to receive data from a serial device. Works great on my win2k pro machine, but my win98se machine won't open com1.
Here's my code:
hCom = CreateFile("COM1:", GENERIC_READ, 0, Null, OPEN_EXISTING, 0, 0)
If hCom <= 0 Then Exit Sub
...
On a win2k pro machine, this returns the handle, and the rest of my code works perfectly.
On a win98se machine, hCom = -1, code exits.
I've tried several permutations of the lpFileName parameter:
"COM1", "COM1:", "\\.\COM1", "\\.\COM1:", ...
Is there a trick?
David <><