Re: Sink events from window.external
From: Mark Guerrieri (mguerrieri_at_nospam_cmsgrp.com)
Date: 02/09/05
- Next message: Michael Harris \(MVP\): "Re: Sink events from window.external"
- Previous message: Igor Tandetnik: "Re: Sink events from window.external"
- In reply to: Igor Tandetnik: "Re: Sink events from window.external"
- Next in thread: Igor Tandetnik: "Re: Sink events from window.external"
- Reply: Igor Tandetnik: "Re: Sink events from window.external"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Feb 2005 18:25:44 -0500
>
> Then make it IOleObjectWithSite::SetSite(NULL)
>
My object is a non-visual automation object created in an out-of-process
server, not an ActiveX control and therefore does not implement
IOleObjectWithSite. It is not unloaded, as it is not hosted by the browser
in the first place. it is simply AddRef'ed when window.external is called
and Released when the browser page goes away, as far as I can tell. The
client application that hosts the browser control holds a reference to the
object to keep it alive.
>
> 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.
>
That is basically what I have already.
It goes like this: I have a single-instance OOP server that acts as a
"Login Service" for my "System." Applications that create an in instance of
my "User" object will launch the OOP server, if it is not already running,
and it will provide a new User object. Each client connects to the same OOP
server, but gets their own "User" object. So I have a single-
instance/multiple-use OOP server that serves unique User objects to clients.
Each client can then call the Login() method of the User object to log in to
the "System" and multple client applications can all be logged in uniquely
at the same time using different User objects.
One particular client application, which hosts a browser control, creates an
instance of the User object. If certain options are selected in the
application, the browser window is displayed. The content of the browser
needs to be able to interact with User object, thus the use of
window.external. The problem is that the interaction between the browser's
content and the User object is not just limited to properties and methods,
but also to handling events. For example, their may be VbScript on the page
like this:
Dim oUser
Set oUser = window.external
oUser.SomeAsyncMethod()
SomeAsyncMethod would do some backround processing and return the results
via an event, and the client would need to sink that event to know when the
method was complete and update the browser's content accordingly. I would
have thought there would be a way to manually hook up an event sink for an
external object, otherwise the ability to extend DHTML through
window.external becomes very limiting in this case.
Mark
- Next message: Michael Harris \(MVP\): "Re: Sink events from window.external"
- Previous message: Igor Tandetnik: "Re: Sink events from window.external"
- In reply to: Igor Tandetnik: "Re: Sink events from window.external"
- Next in thread: Igor Tandetnik: "Re: Sink events from window.external"
- Reply: Igor Tandetnik: "Re: Sink events from window.external"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|