Re: WTL exe acting as COM Server - presume users will latch onto single instance exe
"Angus Comber" <email@example.com> wrote in message
If from a client program, say Visual Basic, I do something like:
Dim xyz As New Angus.Component
It looks from my testing that the Visual Basic client program DOES
NOT run another instance of the exe? Is this the case?
It may or may not be. You control this by choosing the flag you pass to
CoRegisterClassObject, or CComModule::RegisterClassObjects in an ATL
based project. Read about the difference between REGCLS_SINGLEUSE and
the client asks for a New instance!
The client is asking for a new instance of the COM object, not
necessarily a new instance of the server. A single server can serve
multiple objects, of the same or different coclasses.
E.g. MS Excel is a COM automation server that represents every
spreadsheet cell as a separate COM object. You don't expect a new
instance of excel.exe to run for each cell, right?
With best wishes,
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925