//HRASCONN tempH;为全局变量//
if((Ret=RasDial(NULL,NULL,&RasParams,0,NULL,&tempH))!=0)
{
RasHangUp(tempH);
CString RasMessageStr;
RasGetErrorString((UINT)Ret,szRasString,256);
ErrorStr.Format("%s",szRasString);
if(OutFunc!=NULL)
OutFunc(telBook,M_MODEMSTATE,(WPARAM)&ErrorStr,ErrorStr.GetLength());
return false;
}
if((Ret=RasDial(NULL,NULL,&RasParams,0,NULL,&tempH))!=0)
{
RasHangUp(tempH);
CString RasMessageStr;
RasGetErrorString((UINT)Ret,szRasString,256);
ErrorStr.Format("%s",szRasString);
if(OutFunc!=NULL)
OutFunc(telBook,M_MODEMSTATE,(WPARAM)&ErrorStr,ErrorStr.GetLength());
return false;
}
解决方案 »
- WinInet编程 HTTP协议 post数据到htm(或其他类型文件)中,htm或(其他文件类型)该怎么写我才能接受我发送的数据
- C++ 如何响应窗体外鼠标事件
- socket( AF_INET, SOCK_RAW, IPPROTO_IP )的权限问题
- 对话框上画图线条错位的问题
- 如何获取当前用户的"My documents"路径(W2k 和 WXP下)
- 关于TAPI的几个问题,希望高手指点!!!
- TCP/IP编程问题求教,急!!谢谢!!
- 怎样能使SOCK连接后不调用SEND
- 菜虫来问几个关于CFile文件操作的问题,,,,请各位大虾帮助,,,^_^
- 在对话框中,如何显示一幅位图?
- 100分之100:为什么在windows xp下好多驱动程序都不用安装,而 win98,2000等下要?
- 我在用realsdk的COM接口时遇到了以下错误
BOOL CloseAllRASConnections()
{
TRACE0("CloseAllRASConnections()\n");
BOOL bReturn = FALSE;
CRas ras;
if(ras.Init())
{
DWORD dwConnections = 0L;
DWORD dwCount = sizeof(RASCONN) * MAX_RAS_CONNS; RASCONN RasConn[MAX_RAS_CONNS];
RasConn->dwSize = sizeof(RASCONN); // get all active connections
DWORD nRet = ras.EnumConnections( RasConn, &dwCount, &dwConnections);
if (nRet != 0)
{
TRACE1("RasEnumConnections failed: Error = %d\n", nRet);
}
else
{
TRACE0("The following RAS connections are currently active and will be
closed\n"); for (DWORD i = 0; i < dwConnections; i++)
{
TRACE1("Entry name: %s\n", RasConn[i].szEntryName); // close each active connection
nRet = ras.HangUp( RasConn[i].hrasconn);
if(nRet != 0)
TRACE2("HangUp[#%i] failed: Error = %d", i, nRet); file://sleep 3 sec to give the modem some time to respond
Sleep(3 * 1000);
} bReturn = TRUE;
}
} return bReturn;
}