Re: help in Beforenavigate2
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Fri, 24 Aug 2007 09:04:17 -0400
<zidansoft@xxxxxxxxx> wrote in message
news:1187960069.839898.49760@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
MySink* pSink = new MySink;
HRESULT hr5 = pSink->DispEventAdvise(browser_);//
what are thing i missed?
this time after AtlAdvise giving crash(something went to wrong)
pSink is created with a reference count of zero. I guess something
inside DispEventAdvise calls AddRef and then Release on it, resulting in
premature destruction. Try this:
MySink* pSink = new MySink;
pSink->AddRef();
HRESULT hr5 = pSink->DispEventAdvise(browser_);
pSink->Release();
--
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:
- help in Beforenavigate2
- From: zidansoft
- help in Beforenavigate2
- Prev by Date: help in Beforenavigate2
- Next by Date: Re: CHtmlView OLECMDID_PRINT CreateControlSite
- Previous by thread: help in Beforenavigate2
- Index(es):