Eric Smith
August 18th, 1999, 03:42 PM
Ok, here is the situation. I am using TAPI to open a phone line. It opens, dials and connects just fine. When it comes time to write data I am using the following code:
HANDLE commFile=(HANDLE)getModemHandle();
/* commFile is now a handle to the comm port */
/* hopefully we can send data using this */
char data[]="stuff to write, IE all my data goes here";
DWORD written;
if(!WriteFile(commFile,data,strlen(data),&written,NULL))
{
error=GetLastError();
}
/* the flippin data is written */
/* hang up */
commFile comes back from getModemHandle with a value. When it gets to WriteFile(), WriteFile returns with an error "Invalid handle". This doesn't make sense to me unless TAPI is lying and not giving me the modem handle.
Has anyone else had experience in this?
Thanks.
HANDLE commFile=(HANDLE)getModemHandle();
/* commFile is now a handle to the comm port */
/* hopefully we can send data using this */
char data[]="stuff to write, IE all my data goes here";
DWORD written;
if(!WriteFile(commFile,data,strlen(data),&written,NULL))
{
error=GetLastError();
}
/* the flippin data is written */
/* hang up */
commFile comes back from getModemHandle with a value. When it gets to WriteFile(), WriteFile returns with an error "Invalid handle". This doesn't make sense to me unless TAPI is lying and not giving me the modem handle.
Has anyone else had experience in this?
Thanks.