I think your problem is surrounding the access of the DOM from the worker thread. The DOM is not thread safe.
Your plug-in is activex control "I assume" so that means its apartment thread model to run in IE. Estentially this means its running in the thread context of the DOM. The worker thread is running in different context. When your download is complete post a custom message back to the wndproc of your ActiveX Control eiether via SendMessage if you wish to wait until the message is handled or Postmessage if you wish your thread to continue and handle talking to the script there. That way you are in same context
Hope this helps as been long time since I did activex control plugins for IE.
Doug Stastny
Your plug-in is activex control "I assume" so that means its apartment thread model to run in IE. Estentially this means its running in the thread context of the DOM. The worker thread is running in different context. When your download is complete post a custom message back to the wndproc of your ActiveX Control eiether via SendMessage if you wish to wait until the message is handled or Postmessage if you wish your thread to continue and handle talking to the script there. That way you are in same context
Hope this helps as been long time since I did activex control plugins for IE.
Doug Stastny