Thanks Zayin for this:

However someone else pointed me to checking the already present global
ComServer object's StartMode property instead.

It initialises itself using effectively the same check as yours checking
ParamStr(1) for either -Embedding as you state or an alternative
parameter of -Automation similar to the code below. Using this property
saves me from storing my own flag:

if (FindCmdLineSwitch('EMBEDDING', ['-', '/'], True)) or
(FindCmdLineSwitch('AUTOMATION', ['-', '/'], True)) then
begin
  ..automated..
end
else
begin
  ..standalone or just registering..
end;

I am now using
  if (ComServer <> nil) and (ComServer.StartMode = smAutomation) then
  begin
    ..automation only login method..
  end
  else
  begin
    ..request user's credentials..
  end;


Michael Darling
Solutions Analyst/Developer
ROOM Solutions Ltd
mailto:[EMAIL PROTECTED]


-----Original Message-----
From: Zayin [mailto:[EMAIL PROTECTED] 
Sent: 11 March 2005 18:35
To: 'Borland's Delphi Discussion List'
Subject: RE: Determining Com Auto Server instantiation


Hi,

>Does anyone know how to determine whether an Out of process Com 
>Automation
Server executable has been started normally or instantiated by a client?


I use:

if LowerCase(ParamStr(1)) = '-embedding' then
//started by client


HTH


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
*******************************************************************
CONFIDENTIALITY NOTICE/DISCLAIMER
This email and any attachments are confidential, protected by 
copyright/intellectual property rights and may be legally privileged. The 
information transmitted is intended only for the person or entity to which it 
is addressed.  If you are not the intended recipient, dissemination or copying 
of this email is prohibited.
If you have received this in error, please notify us by forwarding this email 
to the following address: [EMAIL PROTECTED] , and then delete the email 
completely from your system.
This email and any attachments have been scanned for computer viruses by a 
market leading anti-virus system. However, it is the responsibility of the 
recipient to conduct its own security measures. No responsibility is accepted 
by ROOM Solutions Limited for loss or damage arising from the receipt or use of 
this email and any attachments.
No responsibility is accepted by ROOM Solutions Limited for personal emails.
ROOM Solutions Ltd, http://www.roomsolutions.net
********************************************************************

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to