title: C# IE BHO: How do I marshal DOM objects to a worker thread?
body: <p>I am trying to write a <a href="http://en.wikipedia.org/wiki/Browser_Helper_Object" rel="nofollow noreferrer">Browser Helper Object</a> (BHO) in C# that manipulates the DOM on a separate thread. I've seen several other questions related to this, and the answer seems to be "you need to marshal the DOM objects from the thread they were created on to your worker thread." Good advice, and it makes perfect sense, but I can find no C# examples on how to do this. There are some vague pointers to some P/Invoke APIs that need to be used, but I'm having difficulty seeing how to implement that into a BHO.</p>
  
  <p>I learn best by example, and the documentation is woefully short of .NET examples of this sort of thing. Can someone point me to an example where, within the context of a managed code BHO, the DOM is manipulated via a worker thread?</p>