OnTimer(UINT nIDEvent)
{
CInternetSession *pSession=new CInternetSession();
CHttpFile *httpFile;
try
{
httpFile=(CHttpFile*)pSession->OpenURL(Url);
}
}
由于是在ontimer里面,当网络环境不好时,会不断弹出多个“操作超时”对话框,而这个对话框多到一定程度时,电脑会变的很慢!如何才能设置一下在超时的时候不弹出这个“操作超时”对话框呢?当然前提不能影响ontimer下一次进入时试图进行新的一次连接,以保证网络正常后仍然可以正常连接
vc 中,CInternetSession OpenURL 如何设置在超时时不弹出“操作超时”对话框
答案:2 悬赏:30 手机版
解决时间 2021-01-29 20:25
- 提问者网友:留有余香
- 2021-01-29 09:53
最佳答案
- 五星知识达人网友:罪歌
- 2021-01-29 10:28
OnTimer(UINT nIDEvent)
{
char buff[1024*20+1];
typedef int (WINAPI ICEPUB_OPENURL)(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy);
ICEPUB_OPENURL *icePub_openUrl = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_openUrl =(ICEPUB_OPENURL *)GetProcAddress(hDLLDrv,"icePub_openUrl");
}
if(icePub_openUrl)
{
icePub_openUrl(Url,buff,1024*20,"");
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
//AfxMessageBox(buff);
}
{
char buff[1024*20+1];
typedef int (WINAPI ICEPUB_OPENURL)(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy);
ICEPUB_OPENURL *icePub_openUrl = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_openUrl =(ICEPUB_OPENURL *)GetProcAddress(hDLLDrv,"icePub_openUrl");
}
if(icePub_openUrl)
{
icePub_openUrl(Url,buff,1024*20,"");
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
//AfxMessageBox(buff);
}
全部回答
- 1楼网友:千夜
- 2021-01-29 11:42
ontimer(uint nidevent)
{
char buff[1024*20+1];
typedef int (winapi icepub_openurl)(char *currenturlstring,char *strhtmltext,int textmaxlen,char *strproxy);
icepub_openurl *icepub_openurl = 0;
hinstance hdlldrv = loadlibrary("icepubdll.dll");
if(hdlldrv)
{
icepub_openurl =(icepub_openurl *)getprocaddress(hdlldrv,"icepub_openurl");
}
if(icepub_openurl)
{
icepub_openurl(url,buff,1024*20,"");
}
if(hdlldrv)
freelibrary(hdlldrv);
//afxmessagebox(buff);
}
希望对你能有所帮助。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯