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 dont work in worker thread [modified]

URLDownloadToFile dont work in worker thread [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++com
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.
  • A Offline
    A Offline
    awah
    wrote on last edited by
    #1

    URLDownloadToFile dont work in worker thread how do i make URLDownloadToFile work in a worker thread. because this is a blocking function, i got to use a worker thread when i call it. but unforturnately when i tried to use it in a thread it doesnt even work at all. its LRESULT return value becomes like -29581853 or something like that. also, the file never shows up in c:\abc.txt here is the code i used download_result=URLDownloadToFile(NULL, yahoo_url, "C:\\abc.txt", 0, NULL); how can i make it work in my worker thread? ref [url]http://msdn2.microsoft.com/en-us/library/ms918866.aspx\[/url\] using vc++6.0 winxp MFC STYLE

    M 1 Reply Last reply
    0
    • A awah

      URLDownloadToFile dont work in worker thread how do i make URLDownloadToFile work in a worker thread. because this is a blocking function, i got to use a worker thread when i call it. but unforturnately when i tried to use it in a thread it doesnt even work at all. its LRESULT return value becomes like -29581853 or something like that. also, the file never shows up in c:\abc.txt here is the code i used download_result=URLDownloadToFile(NULL, yahoo_url, "C:\\abc.txt", 0, NULL); how can i make it work in my worker thread? ref [url]http://msdn2.microsoft.com/en-us/library/ms918866.aspx\[/url\] using vc++6.0 winxp MFC STYLE

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Maybe you need to call CoInitializeEx() on your worker thread.

      awah wrote:

      its LRESULT return value becomes like -29581853 or something like that.

      The exact value, preferrably in hexadecimal, would be much more helpful to us than "something like". :) Mark

      Microsoft MVP - Visual C++

      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