activex - server shutdown question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

activex - server shutdown question

Martin Rubi
Hello.
I'm having the following problem with an activex dll I've done in Dolphin
5.1:

- In the client side, I create an instance of a COM object, and I use it for
a while (it's a class which opens a Dialog)
- after closing the Dialog, the instance is released (in the client side)
- If I try to create another instance again, I can unless ...
- I wait a few seconds (~10), then I can't create instances any more

I think it's related with the fact that a few seconds after all the
instances are released in the client side, the server receives a shutdown
request, but I really can't say that I know what's going on.

I'm using my own AXDllGUISessionManager class which is exactly like
AXDllSessionManager except for the missing method #startUI (and that it's a
GUISessionManager subclass)
As a workaround, I could create an instance of some dummy object and make
the client keep a reference to it during its whole life, but I still would't
know what's going on.
Any clue on what am I doing wrong ?

Thanks in advance
martin


Reply | Threaded
Open this post in threaded view
|

Re: activex - server shutdown question

Blair McGlashan-3
"Martin Rubi" <[hidden email]> wrote in message
news:[hidden email]...

> Hello.
> I'm having the following problem with an activex dll I've done in Dolphin
> 5.1:
>
> - In the client side, I create an instance of a COM object, and I use it
> for
> a while (it's a class which opens a Dialog)
> - after closing the Dialog, the instance is released (in the client side)
> - If I try to create another instance again, I can unless ...
> - I wait a few seconds (~10), then I can't create instances any more
>
> I think it's related with the fact that a few seconds after all the
> instances are released in the client side, the server receives a shutdown
> request, but I really can't say that I know what's going on.
>
> I'm using my own AXDllGUISessionManager class which is exactly like
> AXDllSessionManager except for the missing method #startUI (and that it's
> a
> GUISessionManager subclass)
> As a workaround, I could create an instance of some dummy object and make
> the client keep a reference to it during its whole life, but I still
> would't
> know what's going on.
> Any clue on what am I doing wrong ?
>

You must override #keepAlive to do nothing, otherwise the implementation in
GUISessionManager will shut down the image when it thinks it has quiesced.
This is not appropriate in a DLL.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: activex - server shutdown question

Martin Rubi
Blair, thanks for your answer.

> You must override #keepAlive to do nothing, otherwise the implementation
in
> GUISessionManager will shut down the image when it thinks it has quiesced.
> This is not appropriate in a DLL.

I've done that, but still have the same problem, although I'm not sure it's
a problem. This is what I do now:

- Open a clean image
- Change COMRandomStream>>Next: to answer always 9 (inspired by some old
dilbert strip)
- Deploy corandom.dll

- Open a shell and "regsvr32 corandom.dll"

Now, test it with a client:

- Test it with VB client, always 9, looks good
- Open a clean image
- Inspect this:

    COMRandomStream unregisterClassFactory.
    r := IRandomStream new.
    r next. "it answers 9, so it's using the deployed dll and not this image
.. or it's just luck"

- Evaluate this
    r := nil

- Wait 10 to 15 seconds
- Evaluate this:

    r := IRandomStream new.

It fails with error:

0x80010012 ODSOLE Extended Procedure
The callee (server [not server application])
is not available and disappeared; all connections
are invalid. The call did not execute. (null) 0

This is the same that's happening with my own dll. So my new guess is that
I'm messing things up somehow (registering, unregistering and revoking
factories), or that when using an activex dll, clients are supposed to hold
some interface during their lifetime, in order to avoid shutting down the
image (via shutdownIfDead).
If the latter, then I guess the question is really silly, but did somebody
had a similar behaviour ? And if so, any clue on how to fix it ?

Thanks in advance.
martin