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. URLDownloadtoFile help

URLDownloadtoFile help

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 3 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.
  • R Offline
    R Offline
    Ryan McDermott
    wrote on last edited by
    #1

    Does anyone have code that downloads a file from the internet and saves it into a file. I know I have to use this: HRESULT URLDownloadToFile( LPUNKNOWN pCaller, LPCTSTR szURL, LPCTSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB ); But I am not sure how I get this to work. -Ryan M.

    RaviBeeR M 2 Replies Last reply
    0
    • R Ryan McDermott

      Does anyone have code that downloads a file from the internet and saves it into a file. I know I have to use this: HRESULT URLDownloadToFile( LPUNKNOWN pCaller, LPCTSTR szURL, LPCTSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB ); But I am not sure how I get this to work. -Ryan M.

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      CString strUrl = _T("http://ravib.com");
      CString strFilename = _T("C:\\ravib.txt");
      HRESULT hResult = ::URLDownloadToFile (NULL, strUrl, strFilename, 0, NULL);
      if (hResult != S_OK)
      error();

      /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      R 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        CString strUrl = _T("http://ravib.com");
        CString strFilename = _T("C:\\ravib.txt");
        HRESULT hResult = ::URLDownloadToFile (NULL, strUrl, strFilename, 0, NULL);
        if (hResult != S_OK)
        error();

        /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        R Offline
        R Offline
        Ryan McDermott
        wrote on last edited by
        #3

        thanks ravi. -Ryan M.

        1 Reply Last reply
        0
        • R Ryan McDermott

          Does anyone have code that downloads a file from the internet and saves it into a file. I know I have to use this: HRESULT URLDownloadToFile( LPUNKNOWN pCaller, LPCTSTR szURL, LPCTSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB ); But I am not sure how I get this to work. -Ryan M.

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          Check out this article: Using Internet Explorer to download files for you[^] --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- Laugh it up, fuzzball.

          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