Re: Troubles with ActiveX-EXE (Out-Of-Process Server)



If all the client connections are terminated properly, and the server isn't
continuing to hold references on its own objects, then the ActiveX EXE
should disappear of its own accord. I think your problem is that WantClose()
isn't being called in the 'network disconnection' case. Hence, the ActiveX
EXE's own Collection is keeping references to those objects, even though the
external references have been terminated (DCOM has an internal "ping" every
2 min, and after 3 consecutive failures, the server will understand that the
client has disappeared)

I'd recommend holding a Collection of ObjPtr() values rather than the full
object references themselves. This prevents the ActiveX EXE keeping the
reference counts from going to 0. Alternatively, if you really need to call
on these objects, try a weak reference such as the technique often called
"freeze dried" object references:
http://groups.google.ie/group/microsoft.public.vb.general.discussion/msg/d88c59bed57e120d?hl=en

Tony Proctor

"Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E0377700-FB91-4F75-BE27-6F5EA3AB06E4@xxxxxxxxxxxxxxxx
> Sorry for this stupid text-format. Have copied from notepad. Here is the
same
> text again:
>
> I have some troubles with an ActiveX-Exe written in VB6. It is installad
on
> a Server-PC. Every Client creates one Remote-Instance on the Server with:
> CreateObject( CLASS, SRV ). Additionaly these Objectes are managed in a
> collection by the ActiveX-Exe itself. So the server is able to disconnect
the
> Clients with the following method: The Server fires the Event
"WantClose()".
> After that the Clients have to disconnect and destroy their
Remote-Instances
> (set to Nothing).
>
> That is working fine. However there are situations, where the client isn't
> able to disconnect itself (i.e. the network-connection has lost, or the
> client-application hangs). What now? The server can remove the object from
> its collection, but it can't decrement the Reference-Counter for the
Client.
> And so the Instance won't be destroyed by (D)COM.
>
> In this situation, the only way out is: Go to the Server and kill the
> process with the taskmanager. But that's unaccepteble with approximately
150
> customers. And this situation happens very often in a scenario with 15
> Clients and a Server, which is running 24 Hours, 7 Days the week. A simple
> network-break is enough to produce this memory-leak.
>
> The bottom line is now:
> Is there a possibility, to destroy these Objects without killing the
process
> manually? This is very important for us, because there are situations, we
> have to restart our Applications. And how should the User update the
> ActiveX-EXE from an Installer-Programm, when the Component is hanging?
>
>
> Thanks in advance for tipps and suggestions
> and a nice weekend,
>
> Peter


.



Relevant Pages

  • Re: CORRECTED TEST AND ANSWERS.
    ... What is version compatibility option useful for? ... Why can't an in-process ActiveX server be compiled as an EXE. ... the instance that oneObj currently references too. ...
    (microsoft.public.vb.general.discussion)
  • Re: ActiveX control and Authorization issue
    ... security settings the way you do in standalone apps. ... > I am running a DCOM server on Win XP Pro, developed with VC++ 6, MFC. ... My typical client setup makes the SAME CALL to ... This has always worked until I wrote an ActiveX ...
    (microsoft.public.win32.programmer.ole)
  • Re: RWW Errors Make No Sense
    ... That's for the ActiveX issue, but it's very possible the 'server unavailable' is due to first issue ... Try resetting the IE settings to their previous levels and then follow the ... > They then "connect to client computer". ...
    (microsoft.public.windows.server.sbs)
  • Error in Loading DLL when creating class instance from ActiveX EXE
    ... ActiveX EXE. ... Both the client and server are installed on the same platform. ...
    (microsoft.public.vb.com)
  • Re: RWW Errors Make No Sense
    ... Do you know if this also corrects the "server unavailable" issue or just the ... ActiveX issue? ... Try resetting the IE settings to their previous levels and then follow the ... They then "connect to client computer". ...
    (microsoft.public.windows.server.sbs)

Loading