Hi,

I have a Windows application which exports COM interfaces.  When it starts
up, it invokes CoRegisterClassObject() to register its class objects with
the following flags:

dwClsContext = CLSCTX_LOCAL_SERVER
flags = REGCLS_MULTIPLEUSE

My intent is that a single instance or activation of the application will
serve multiple COM clients.

I used VS.NET to add a reference to the application's type library, which
generates an RCW DLL.  I wrote a simple C# program which invokes a method
on one of the COM objects interfaces using the RCW.

Finally, I launch my application.  The first time I run the C# program,
everything works fine.  However, if I run it again, this time the RCW
apparently tries to launch another instance of my application (which I
explicitly disallow), then times out waiting for the COM server to
respond.  At this point, even though my application is still running, if I
try to access its COM interfaces from another client (e.g. JScript or VB),
the same behavior occurs, another instance of my application is launched.
Once I quit the original instance of my application and relaunch it,
everything works again.

If I access my application's COM interfaces from a C program, JScript, VB,
Perl, etc. I don't get this behavior, I can run multiple clients against
the single application activation just fine.  Is this a known issue?  Do I
need to roll my own interop assembly instead of using TLBIMP?

Jeff

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to