Re: IWebBrowser2 and html document with frames.
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Sun, 18 Sep 2005 23:58:41 -0400
"Chimanrao" <chimanrao@xxxxxxxxx> wrote in message
news:1127057126.968767.32900@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Does this mean that I need to create a separate object to sink the
> event each time DocumentComplete event gets called?
In theory, you can have the same sink handle events from multiple
documents. In practice, it makes it difficult to find out which document
an event is coming from. It is usually wise to indeed have a separate
sink object for each document (of course they can all be instances of
the same class).
> Does the DispEventAdvise call increase the ref count on my object i.e.
> let say I navigate from one page with 3 frames to another page with 3
> frames, the objects that I used to the first time to sink the events
> do they get managed automatically thru the the AddRef, Release
> mechanism?
When you advise, your sink is AddRef'ed (the source stores an interface
pointer to it). When a page is navigated away from, you should
explicitly unadvise your sinks and release all references you might have
held on the document and/or its elements. Otherwise the document object
will hang around in memory, and you'll get huge memory leaks. See here
for the scheme I suggest:
http://groups.google.com/group/microsoft.public.inetsdk.programming.webbrowser_ctl/msg/acf00eb05dbf0237
> Do we get a separate IWebBrowser2 object for each frame?
Yes you do.
> How different
> is it from the IWebBrowser2 object obtained in SetSite?
It's a distinct pointer to a distinct instance. Other than that, it has
all the same properties and methods. I guess I don't quite understand
this question.
> If these things are documented somewhere, can you point me to the
> link? I looked up on MSDN, but could not find it
I don't believe they are exactly laid out in one place somewhere. One
could gather this information in bits and pieces here and there. I
consider myself something of a collector of IE programming trivia. A
hobby, if you will.
--
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:
- IWebBrowser2 and html document with frames.
- From: Chimanrao
- Re: IWebBrowser2 and html document with frames.
- From: Igor Tandetnik
- Re: IWebBrowser2 and html document with frames.
- From: Chimanrao
- IWebBrowser2 and html document with frames.
- Prev by Date: Re: IWebBrowser2 and html document with frames.
- Next by Date: Re: How can I get the Office version
- Previous by thread: Re: IWebBrowser2 and html document with frames.
- Next by thread: Re: How can I get the Office version
- Index(es):
Relevant Pages
|