Re: Sink events from window.external

From: Mark Guerrieri (mguerrieri_at_nospam_cmsgrp.com)
Date: 02/09/05


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



Relevant Pages

  • Re: Sink events from window.external
    ... server, not an ActiveX control and therefore does not implement ... and Released when the browser page goes away, as far as I can tell. ... client application that hosts the browser control holds a reference to the ... Each client can then call the Loginmethod of the User object to log in to ...
    (microsoft.public.scripting.vbscript)
  • Re: Sink events from window.external
    ... server, not an ActiveX control and therefore does not implement ... and Released when the browser page goes away, as far as I can tell. ... client application that hosts the browser control holds a reference to the ... Each client can then call the Loginmethod of the User object to log in to ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Pure client-side javscript database?
    ... the individual asking the question in their single context. ... in the current browser instance and a respondent assumes the question ... >>> that the client may download an application from a server ... >>> server, but the APPLICATION may or may not be. ...
    (comp.lang.javascript)
  • Another option (was Re: AJAJS - thin client web app using mainly XMLHTTPRequest and eval())
    ... running on the client. ... but is a Web-Server really an Application Server?) ... Password Caching or generic Work-Station or Browser ... Predictive text on the Queue Name field so that all matching VMS queues ...
    (comp.lang.javascript)
  • Re: Still Need desperate help to start with ASP NET - simplified problems - HELP!!
    ... complicate means that there are some hundred thousand code lines ... via web services to the win appication on the server. ... featured application (say thick client) which does a lot of complicate ... to deliver to the IE user, creating a smart client within its browser. ...
    (microsoft.public.dotnet.framework.aspnet)

Loading