Board index » delphi » Detecting Automation

Detecting Automation

Is there any way I can detect that my app is being started by automation,
this needs to be done at form creation.

I have an app which I am trying to COM enable.  The problem is that normally
the app pauses during start-up to show a splash screen, but if this happens
during automation I get access violations due to the fact that the app is
not up and running in time for the next automation statement.

Paul Darling

 

Re:Detecting Automation


Just override procedure Initialize of  TAutoObject. This procedure is called
every time someone instanitates your app through COM.

Fitim Skenderi

Quote
"Paul Darling" <Pjd.Computerservi...@btinternet.com> wrote in message

news:3d8739a1$1@newsgroups.borland.com...
Quote
> Is there any way I can detect that my app is being started by automation,
> this needs to be done at form creation.

> I have an app which I am trying to COM enable.  The problem is that
normally
> the app pauses during start-up to show a splash screen, but if this
happens
> during automation I get access violations due to the fact that the app is
> not up and running in time for the next automation statement.

> Paul Darling

Re:Detecting Automation


Please excuse my ignorance but I'm not sure a) how to do this, and b) how
this will help.

I have the following

  Application.CreateForm(TMainForm, MainForm);
  Application.CreateForm(TSplash, Splash);
  Application.CreateForm(Tudm_dlg, udm_dlg);
  Splash.Show;
  Splash.Update;
  Splash.delay(2000);
  Application.CreateForm(TDM1, DM1);

and need to be able to omit (or change) the line
  Splash.delay(2000);
when being automated.

Quote
"Fitim Skenderi" <fit...@hotmail.com> wrote in message

news:3d8750c3$1@newsgroups.borland.com...
Quote
> Just override procedure Initialize of  TAutoObject. This procedure is
called
> every time someone instanitates your app through COM.

> Fitim Skenderi

> "Paul Darling" <Pjd.Computerservi...@btinternet.com> wrote in message
> news:3d8739a1$1@newsgroups.borland.com...
> > Is there any way I can detect that my app is being started by
automation,
> > this needs to be done at form creation.

> > I have an app which I am trying to COM enable.  The problem is that
> normally
> > the app pauses during start-up to show a splash screen, but if this
> happens
> > during automation I get access violations due to the fact that the app
is
> > not up and running in time for the next automation statement.

> > Paul Darling

Re:Detecting Automation


<<Paul Darling:
Is there any way I can detect that my app is being started
by automation

Quote

Check the TComServer.StartMode property.

--
Deborah Pate (TeamB) http://delphi-jedi.org

  Use Borland servers; TeamB don't see posts via ISPs
  http://www.borland.com/newsgroups/genl_faqs.html

Other Threads