Re: Thread apartment IE7
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Thu, 4 Jan 2007 08:24:06 -0500
"Cedric Scheyder" <cedric.scheyder@xxxxxxxxxxxxxxxxx> wrote in message
news:A1C1119C-AEEE-4DF8-B966-878BCF2F22E6@xxxxxxxxxxxxx
I'm trying to create a worker thread to deal with network I/O in a
BHO.
I have a class that save the IUknown object to a pointer.
It creates then the worker thread.
I have a function that list a frames in a IHTMLDocument2 object that
works fine when called from the main thread, but it crashes on
myDoc->get_frames(&pFrameColls) when called from the worker thread.
Even if i marshall it or not.
In debug mode, all pointers seem exactly the sames in worker or main
thread.
Show the code where you marshal the pointers. After marshalling you
should definitely get a pointer different from the original raw pointer.
You are doing something wrong.
Do you initialize COM on the worker thread?
Note that it's largely pointless to manipulate DOM from a worker thread.
You already know that all MSHTML interface pointers need to be
marshalled to the worker. Every method call through such a marshalled
pointer is transferred to the main thread, executed there, and any
results marshalled back to the worker. At the end of the day, the
"worker" doesn't really do any work, it spends most of its time waiting
on the main thread to do it instead.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Prev by Date: Re: Form submit not loading web page
- Next by Date: Re: Thread apartment IE7
- Previous by thread: Form submit not loading web page
- Next by thread: Re: Thread apartment IE7
- Index(es):
Relevant Pages
|
Loading