Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. verify existency of URL ( with proxy )

verify existency of URL ( with proxy )

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++html
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • L Lost User

      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

      A Offline
      A Offline
      A R 0
      wrote on last edited by
      #2

      Have you tried? try { ... pIH = InternetOpenURL(...); ... } catch (InternetException* pEx) { ::MessageBox(...); // Handle your exception }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups