|
-
Aug 24th, 2001, 12:44 PM
#1
Thread Starter
Lively Member
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 <><
Last edited by DaveAMS; Aug 24th, 2001 at 12:49 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|