Comm Port setup not complete

G

Guest

Hello

I am using a serial port to communicate with an embedded device. I am using CreateFile, WriteFile & ReadFile. It all works great until I run a VB6 application that uses the serial port. After I run the VB6 application, the ReadFile no longer waits for a character, it simply falls through. If I open HyperTerm and close it, again my app works.

CreateFile, GetCommState, SetupComm, SetCommState & PurgeComm all return successfully. Any ideas

Thanks
Pete
 
W

William DePalo [MVP VC++]

PeteC said:
I am using a serial port to communicate with an
embedded device. I am using CreateFile, WriteFile
& ReadFile. It all works great until I run a VB6
application that uses the serial port. After I run the
VB6 application, the ReadFile no longer waits for
a character, it simply falls through. If I open
HyperTerm and close it, again my app works.
CreateFile, GetCommState, SetupComm, SetCommState & PurgeComm all return
successfully. Any ideas?

I would suggest that you take a look at SetCommTimeouts(), too.

If that fails you, I'd double check the return codes from each of the
functions. It seems as though one or more may have no effect and that
HyperTerminal is actually setting the prort's state.

Regards.
Will
 
G

Guest

Will

You know, I hate how obvious things are once you find the problem

Thanks
Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top