Re: Thread apartment IE7
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Thu, 4 Jan 2007 08:40:58 -0500
"Cedric Scheyder" <cedric.scheyder@xxxxxxxxxxxxxxxxx> wrote in message
news:11C750DB-5D66-4F05-9E50-B90B9A1780B5@xxxxxxxxxxxxx
if (!pUnkSite)
ATLTRACE("\nSetSite(): pUnkSite is NULL\n\n");
else
{
// Query pUnkSite for the IWebBrowser2 interface.
m_spWebBrowser2 = (IWebBrowser2 *)pUnkSite;
//m_spWebBrowser2->AddRef();
HRESULT hr = CoMarshalInterThreadInterfaceInStream (IID_IWebBrowser2,
m_spWebBrowser2, &pStream);
and in worker thread :
HRESULT hr = CoInitialize(NULL);
hr = CoGetInterfaceAndReleaseStream(pStream,IID_IWebBrowser2,(VOID
**)&m_spWebBrowser2);
GetText();
where GetText parse frames of the documents.
You appear to be using the same member variable, m_spWebBrowser2, in
both places. Of course the two pointers appear the same - you are
overwriting one with the other. Give the worker thread its own variable
in which to keep the pointer.
--
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
.
- References:
- Re: Thread apartment IE7
- From: Igor Tandetnik
- Re: Thread apartment IE7
- Prev by Date: Re: Thread apartment IE7
- Next by Date: Re: Thread apartment IE7
- Previous by thread: Re: Thread apartment IE7
- Next by thread: Re: Thread apartment IE7
- Index(es):
Relevant Pages
|
Loading