Board index » delphi » How to launch mutilple out-of-process servers

How to launch mutilple out-of-process servers

Hi,

I recently started using Delphi to create with out-of-process servers and
have a question about create multiple servers The Delphi help states under
TClassInstancing this:

<clip>

ciSingleInstance

Allows only a single instance of the COM object for each executable
(application).  If this single instance is not shared across multiple
clients, then each client must launch its own instance of the executable.

<clip>

The problem is that each client executable seems to share the same server
executable.

  ...
  FShapes: Variant;
  ...

procedure TClientForm.ConnectButtonClick(Sender: TObject);
begin
  FShapes := CreateOleObject('Shapes.ShapeDialog');
end;

How can I have a distinct server process for each client? I tried launching
a server executable using CreateProcess before I call CreateOleObject, but
the clients still share the first launched server. Looking at the help again
"then each client must launch its own instance of the executable". What do I
need to do to create multiple out-of-process servers?

Anthony Walter
sys...@hotmail.com

 

Re:How to launch mutilple out-of-process servers


You might want to try using an In-Proc Server.  It resides in the same process
as the calling application, and is not shared.
Quote
Anthony Walter wrote:
> Hi,

> I recently started using Delphi to create with out-of-process servers and
> have a question about create multiple servers The Delphi help states under
> TClassInstancing this:

> <clip>

> ciSingleInstance

> Allows only a single instance of the COM object for each executable
> (application).  If this single instance is not shared across multiple
> clients, then each client must launch its own instance of the executable.

> <clip>

> The problem is that each client executable seems to share the same server
> executable.

>   ...
>   FShapes: Variant;
>   ...

> procedure TClientForm.ConnectButtonClick(Sender: TObject);
> begin
>   FShapes := CreateOleObject('Shapes.ShapeDialog');
> end;

> How can I have a distinct server process for each client? I tried launching
> a server executable using CreateProcess before I call CreateOleObject, but
> the clients still share the first launched server. Looking at the help again
> "then each client must launch its own instance of the executable". What do I
> need to do to create multiple out-of-process servers?

> Anthony Walter
> sys...@hotmail.com

Re:How to launch mutilple out-of-process servers


If you look at the memoedit/autodemo sample that comes with Delphi, that is
ciSingleInstance. You'll notice that if you run multiple instances of the
client, each will get its own server instance.

have fun
--
Binh Ly
Visit my COM Notes at http://www.castle.net/~bly/com

Quote
Anthony Walter <sys...@hotmail.com> wrote in message

news:7ticgs$mpg11@forums.borland.com...
Quote
> Hi,

> I recently started using Delphi to create with out-of-process servers and
> have a question about create multiple servers The Delphi help states under
> TClassInstancing this:

> <clip>

> ciSingleInstance

> Allows only a single instance of the COM object for each executable
> (application).  If this single instance is not shared across multiple
> clients, then each client must launch its own instance of the executable.

> <clip>

> The problem is that each client executable seems to share the same server
> executable.

>   ...
>   FShapes: Variant;
>   ...

> procedure TClientForm.ConnectButtonClick(Sender: TObject);
> begin
>   FShapes := CreateOleObject('Shapes.ShapeDialog');
> end;

> How can I have a distinct server process for each client? I tried
launching
> a server executable using CreateProcess before I call CreateOleObject, but
> the clients still share the first launched server. Looking at the help
again
> "then each client must launch its own instance of the executable". What do
I
> need to do to create multiple out-of-process servers?

> Anthony Walter
> sys...@hotmail.com

Other Threads