Click to See Complete Forum and Search --> : serial communication


John McClure
May 20th, 1999, 11:27 PM
I can open a serial port in this way.

hCommPort = CreateFile("COM2", GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

if ( hCommPort == INVALID_HANDLE_VALUE )
{
AfxMessageBox("NOT VALID COM2");
return;
}




It detects if a port is in use. Unfortunately if my mouse is connected it hangs the mouse.

How can I check if a port is free without hanging my mouse. Win95/98.

Any ideas?

Thanks

Ran
May 29th, 1999, 08:17 AM
Maybe only you should use GENERIC_READ ?

BTW: I would like my dial program (TAPI) to set volume and probably some registers on a modem. Do you know a way to do that?

bye