首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

VC adsl拨号返回632

2013-03-25 
VC adsl拨号返回632 求助本帖最后由 daibei008 于 2012-09-23 23:10:20 编辑在原先的平台使用vc6+xp可以顺

VC adsl拨号返回632 求助
本帖最后由 daibei008 于 2012-09-23 23:10:20 编辑 在原先的平台使用vc6+xp可以顺利的使用 自动拨号的程序,现在把vc6换成vs2010 的vc++,返回632,求助,整个在vc6环境下顺利运行的项目已经上传在附件中,查询的主要问题是

**************************************************************************
HRASCONN hRasConn = NULL;
RASDIALPARAMS rdParams;
ZeroMemory(&rdParams, sizeof(RASDIALPARAMS));
rdParams.dwSize = sizeof(RASDIALPARAMS);
CString strEntryName = m_strPPPoEName;

dwRet = ::RasDial(NULL, NULL, &rdParams, 0L, /*RasDialFunc*/NULL , &hRasConn);  //如果函数成功,则返回0
if (dwRet)
{
char  szBuf[256] = "";
::RasGetErrorString((UINT)dwRet, (LPSTR)szBuf, 256);
TRACE("%s",CString(szBuf));
//SetDlgItemText(IDC_CONNECT_STATE,CString("连接错误! ") + CString(szBuf) );
CString s;
s.Format("连接错误! 错误代码:%d 说明 %s",dwRet,szBuf);
    AfxMessageBox(s);
//WinExec("rasphone -a",SW_SHOW);
return -1;
}  

始终报错632,结构大小错误
******************************************************

完整的vc6版本正常运行项目放在下载资源里了http://download.csdn.net/detail/daibei008/4591099



[解决办法]
lpRasDialParams 
Pointer to a RASDIALPARAMS structure that specifies calling parameters for the RAS connection. Use the RasGetEntryDialParams function to retrieve a copy of this structure for a particular phone-book entry. 

The caller must set the RASDIALPARAMS structure's dwSize member to sizeof(RASDIALPARAMS) to identify the version of the structure being passed.

If the szPhoneNumber member of the RASDIALPARAMS structure is an empty string, RasDial uses the phone number stored in the phone-book entry.

MSDN说要用RasGetEntryDialParams()函数获得RASDIALPARAMS结构,不要直接用sizeof

热点排行