Im writing a BHO for internet explorer where i need to call javascript methods on all open browser instances from a 'static' (or a 'global') callback method. I'm running into issues that i'm sure are related to multi-threading in COM. I had few general questions regarding this (i am new to windows programming!).
Every browser would have its own IWebBrowser2 object pointed to by CComPtr. If i have a static callback method in my BHO class, which thread would that callback arrive on? Would it be anyone of the BHO threads that were created by IE?
I tried to caching all the IWebBrowser2 pointers created in every BHO and access them later from the static method. However, i think there are some issues of un/marshalling involved. Firstly, would this work? Also, any suggestions on a good/(or different) approach on doing this?
~Thanks