Re: help in Beforenavigate2



<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


.