views:

30

answers:

2

i have a ie7 add on, i'm adding html elements to the page being browsed.

ie throws operation aborted, and dont nevigate to the page, anyone knows what to do?

i work asynchronously with the html elements adding

+1  A: 

The IE DOM objects are all STA object. Which means you can only use them on the thread they were created on, which is the Tab UI thread.

If you need to use them from a background thread, you must marshal the object from one apartment to the other. This is accomplished fairly easily using the Global Interface Table.

jeffamaphone
is there a way that i can tell the ui thread to create and manage the dom objects?
Chen Kinnrot
like in winform with sync context
Chen Kinnrot
The thread where you initially get the pointer to the DOM object, that's the thread they were created on.
jeffamaphone
i know that but how do i get him with code and send him a delegate??
Chen Kinnrot
A: 

The best way to make sure you work with the main thread of your web browser helper is to do all of your async work in background worker.

the second option is to create a syncronization context and allways perform dom changes from the sync context

Chen Kinnrot