Board index » delphi » Detecting ole automation

Detecting ole automation

Hi

I have got a small Delphi application which can be run on its own or as
an out-of-process ole automation server. How can I detect which mode is
being run as I would like to change the menus in the application
according to the mode being run?
For example, if the application is running normally I would like to see
a 'File Menu', if it run as an automation server I would like to disable
the 'File Menu'. A possible solution if for the client to invoke a
method to disable the menus but I would like to do it as soon as the
application starts in automation mode without the client specifically
disabling the menu!

Thank you in advance.
Paulo

 

Re:Detecting ole automation


You want TComServer.StartMode

type TStartMode = (smStandalone, smAutomation, smRegServer, smUnregServer);

Regards,

Joel Milne
SoftMosis Consulting Inc.
www.softmosis.ca

Quote
Paulo Pinheiro <p...@techprt.co.uk> wrote in message

news:3701DF64.CBA5FF0A@techprt.co.uk...
Quote
>Hi

>I have got a small Delphi application which can be run on its own or as
>an out-of-process ole automation server. How can I detect which mode is
>being run as I would like to change the menus in the application
>according to the mode being run?
>For example, if the application is running normally I would like to see
>a 'File Menu', if it run as an automation server I would like to disable
>the 'File Menu'. A possible solution if for the client to invoke a
>method to disable the menus but I would like to do it as soon as the
>application starts in automation mode without the client specifically
>disabling the menu!

>Thank you in advance.
>Paulo

Re:Detecting ole automation


The parameters -EMBEDDING or -AUTOMATION are sent to your app when running
as a server.

Just test them with FindCmdLineSwitch

Koj

Other Threads