1

So i have a function to download a HTML file. And as it takes a significant amount of time, i've put it in a separate thread that works on the background and the program remains responsive. When i call the function from the main thread it works fine. But calling from the other thread causes getinputstream() to always return NULL. so, what is causing this? and how do i fix this?
PS, i'm using wxwidgets 2.8 on Visual Studio 10.

Shashwat Black
  • 992
  • 5
  • 13
  • 24
  • 1
    I think here is similar problem http://stackoverflow.com/questions/10067056/wxhttp-threads – Andrey Mar 02 '13 at 03:53

1 Answers1

1

You have to call wxHTTP::Initialize() in main thread (not only in wxApp:onInit()). Blatantly copied from here just so that question is answered.

Community
  • 1
  • 1
Andrey
  • 59,039
  • 12
  • 119
  • 163