fox404
asked on
Code for dialing to a server using a modem
Hi All,
Below is the extract of code for dialing to a server using a modem. It is working fine in Win98 but not in Win2000 and XP.
The modem returns a string “Error”.
CString m_ServerNum = “9,64809988”;
CString serverCmd = "ATV1Q0DT";
serverCmd = serverCmd+m_ServerNum;
serverCmd.Insert(serverCmd .GetLength (),13);
UINT len = serverCmd.GetLength();
char* StartupStr = (LPTSTR)serverCmd.GetBuffe r(len);
if (!::WriteFile (hPort, StartupStr, len, &BytesWritten, NULL))
return ERROR;
Below is the extract of code for dialing to a server using a modem. It is working fine in Win98 but not in Win2000 and XP.
The modem returns a string “Error”.
CString m_ServerNum = “9,64809988”;
CString serverCmd = "ATV1Q0DT";
serverCmd = serverCmd+m_ServerNum;
serverCmd.Insert(serverCmd
UINT len = serverCmd.GetLength();
char* StartupStr = (LPTSTR)serverCmd.GetBuffe
if (!::WriteFile (hPort, StartupStr, len, &BytesWritten, NULL))
return ERROR;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
serial programming in Win2000/NT/XP is quiet different from Win98
Have a look to this ready made serial objects, and related articles:
http://www.codeproject.com/system/serial.asp
http://www.codeproject.com/system/chaiyasit_t.asp
http://www.codeproject.com/system/simpleserialcomm.asp
http://www.codeproject.com/system/cserialcom.asp
http://www.codeproject.com/system/serial_com.asp
http://www.codeproject.com/system/cserialport.asp
http://www.codeproject.com/internet/tserial_event.asp
Have a look to this ready made serial objects, and related articles:
http://www.codeproject.com/system/serial.asp
http://www.codeproject.com/system/chaiyasit_t.asp
http://www.codeproject.com/system/simpleserialcomm.asp
http://www.codeproject.com/system/cserialcom.asp
http://www.codeproject.com/system/serial_com.asp
http://www.codeproject.com/system/cserialport.asp
http://www.codeproject.com/internet/tserial_event.asp
ASKER
I did try this code "WriteFile" in Window98, it is working, but in Windows 2000 and Windows XP it is not working!
Do you have any idea?
Fox404