verify existency of URL ( with proxy )
-
Dear all, I am writing a programme using VC++ to display html or other kind of web page as help files. To make it more advance, I need to check the existency of the given URL before display it out so that it will browse to an user-default "unavailable page" instead of the usual 404-error page. I am now facing a problem to verify the URL. I have tried several ways and none seems to work. 1. using InternetOpen follow by InternetOpenURL to check if it return a valid handle. 2. trying to use OnDownloadComplete through DISP_FUNCTION_MAP in CView ( as my IWebBrowser2 is not in CHtmlView, I cannot use DWebBrowserEvent ) for case (1), InternetOpenURL other return NULL with error code 997 for all kind ( exist or non-exist ) of URL if InternetOpen using INTERNET_FLAG_ASYNC for the dwFlag.. think there is a bug in MFC as told in Microsoft KB(Q176176) or, InternetOpenURL other return a valid handle for all kind ( again exist or non-exist ) of URL if InternetOpen using 0 for the dwFlag.. obviously this is wrong as I would like to receive NULL for non-exist URL. for case (2), I got problem when I try to call AfxConnectionAdvise(), it fail when it step into pCPC->FindConnectionPoint(iid, &pCP) in CTLCONN.cpp line 166 and return handle 0x80004002 ( which I found out as CdoE_INTERFACE_NOT_SUPPORTED, but I am not 100% sure ).. have anyone faced this kind of problem before. hope you could help Thanks in advance. Regards, Kathy
-
Dear all, I am writing a programme using VC++ to display html or other kind of web page as help files. To make it more advance, I need to check the existency of the given URL before display it out so that it will browse to an user-default "unavailable page" instead of the usual 404-error page. I am now facing a problem to verify the URL. I have tried several ways and none seems to work. 1. using InternetOpen follow by InternetOpenURL to check if it return a valid handle. 2. trying to use OnDownloadComplete through DISP_FUNCTION_MAP in CView ( as my IWebBrowser2 is not in CHtmlView, I cannot use DWebBrowserEvent ) for case (1), InternetOpenURL other return NULL with error code 997 for all kind ( exist or non-exist ) of URL if InternetOpen using INTERNET_FLAG_ASYNC for the dwFlag.. think there is a bug in MFC as told in Microsoft KB(Q176176) or, InternetOpenURL other return a valid handle for all kind ( again exist or non-exist ) of URL if InternetOpen using 0 for the dwFlag.. obviously this is wrong as I would like to receive NULL for non-exist URL. for case (2), I got problem when I try to call AfxConnectionAdvise(), it fail when it step into pCPC->FindConnectionPoint(iid, &pCP) in CTLCONN.cpp line 166 and return handle 0x80004002 ( which I found out as CdoE_INTERFACE_NOT_SUPPORTED, but I am not 100% sure ).. have anyone faced this kind of problem before. hope you could help Thanks in advance. Regards, Kathy