Re: Sink events from window.external

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 02/09/05


Date: Wed, 9 Feb 2005 16:58:31 -0500


"Mark Guerrieri" <mguerrieri@cmsgrp.com> wrote in message
news:ewH3WruDFHA.2232@TK2MSFTNGP14.phx.gbl
> Interesting idea- but how would I know when to release the cached
> interface?

When you are being unloaded, usually when
IOleObject::SetClientSite(NULL) is called

> My COM object lives externally to the browser component,

Then make it IOleObjectWithSite::SetSite(NULL)

> and many different pages will be loaded into the browser during its
> lifetime.

Are you saying you have a COM singleton? Bad idea. Instead of giving out
the same object to every client, create a separate object for each
client, and have them forward method calls to a C++ singleton (that is
not exposed to the clients directly). Then each COM object can take care
of its event sinks.

-- 
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 


Relevant Pages

  • Re: Windows Service in VB
    ... Your service needs to expose an interface via .Net remoting. ... and register the public class as a well-known singleton. ... You also need to create a WinForms app that can be run by logged-in users. ... if your client app just wants to call methods on the service's remoted ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sink events from window.external
    ... "Mark Guerrieri" wrote in message ... Are you saying you have a COM singleton? ... client, and have them forward method calls to a C++ singleton (that is ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Sink events from window.external
    ... "Mark Guerrieri" wrote in message ... Are you saying you have a COM singleton? ... client, and have them forward method calls to a C++ singleton (that is ...
    (microsoft.public.scripting.vbscript)
  • Re: Singletons
    ... Such attributes are usually initialized by the constructor or a factory object when the object in hand is created. ... There are actually two objects involved in Singleton. ... To access that method there must already be a relationship that can be navigated by the client to get to the Singleton object to invoke GetInstance. ... When Singleton passes back the reference to Client it is temporarily instantiating the R3 relationship between Client and the Collaborator that Client navigates when it talks to Collaborator. ...
    (comp.object)
  • Re: What doesnt lend itself to OO?
    ... >>server is a pure data transfer interface. ... essentially exposing the client or service implementation. ... >>paradigms can be abstracted just like any other problem space in an OO ...
    (comp.object)

Loading