Board index » cppbuilder » Am I Auto controlled?

Am I Auto controlled?

When you write an app, then add an Automation object to it so it can be
invoked via automation, what are the ways an app can tell that it's been
invoked via automation
versus being started by a user?

(I guess one way would be for all your Auto interface functions to set a
program flag that they've been called.. thus signalling that the app was
invoked from ole.. but this seems kind of overkill..)

Thanks!
Michael

 

Re:Am I Auto controlled?


I'm catching this information in the automation "Impl" class' constructor.
You'll get an instance of this class for each client, and no instances if
the user started you up manually.
Quote
Michael Lovett wrote in message <37205222.436DE...@morpace.com>...
>When you write an app, then add an Automation object to it so it can be

Re:Am I Auto controlled?


Quote
Michael Lovett wrote:

> When you write an app, then add an Automation object to it so it can be
> invoked via automation, what are the ways an app can tell that it's been
> invoked via automation
> versus being started by a user?

> (I guess one way would be for all your Auto interface functions to set a
> program flag that they've been called.. thus signalling that the app was
> invoked from ole.. but this seems kind of overkill..)

From the way you are asking the question, I suspect an architectural
problem of some sort. :)

The guess is the right answer: your automation interface should
do something which provides whatever context information is needed
to the actual methods of the application.

Re:Am I Auto controlled?


Anoter thing I've noticed:

when your exe is started for automation it's passed /Automation in the command
line.. an app could check this, too.

Quote
aphr...@sects.org wrote:
> Michael Lovett wrote:

> > When you write an app, then add an Automation object to it so it can be
> > invoked via automation, what are the ways an app can tell that it's been
> > invoked via automation
> > versus being started by a user?

> > (I guess one way would be for all your Auto interface functions to set a
> > program flag that they've been called.. thus signalling that the app was
> > invoked from ole.. but this seems kind of overkill..)

> From the way you are asking the question, I suspect an architectural
> problem of some sort. :)

> The guess is the right answer: your automation interface should
> do something which provides whatever context information is needed
> to the actual methods of the application.

Other Threads