Go Premium for a chance to win a PS4. Enter to Win


Detecting an automation call

Posted on 2000-05-09
Medium Priority
Last Modified: 2010-04-04
Hi everyone...

I want to do the following: I have a form, which also contains an OLE automation server. So far so good, but how can the application figure out, if it was started by an automation call or directly by a user? I know, I could add a boolean variable or other means to the initilize function of the automation server, but the Form.Create is being called first. I want to forbid the user to call the application directly. Instead the user should get a dialog box. Like I said, the problem is, that the initilize function is being called after the form is being created, so I can't tell if the automation server is going to be created or not. Any ideas?

Regards, Jonny...
Question by:jonnyfive
LVL 10

Expert Comment

ID: 2793078
Jonny, before diving too much into the problem: what about renaming the application to DLL? This will prevent the user from starting it and it still can be used as automation server (even the icon remains the same :-).

Ciao, Mike

Author Comment

ID: 2793792
Hi Lischke :-)

Good idea, has one problem though... How do you register this one? Does regsvr32 work? I would still like to know, how I could dectet it... might get handy some time :-)

Regards, Jonny...
LVL 10

Expert Comment

ID: 2793878
Mmmh, good point. Try to figure out whether the application exports DLLRegisterServer and 3 other functions (using QuickView from Windows or tdump from Delphi). These functions are used for registering. I doubt this mechanism is different to that of DLLs, but am not sure, though...

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Expert Comment

ID: 2796354
Listening.. and hopeing too

Accepted Solution

apostolost earned 400 total points
ID: 2804062
Hi all,

You can check how your application was started using something like

if comserver.startmode=smautomation then ...

see the online help on startmode for other useful options.


Author Comment

ID: 2804562
Wow... thanks... exactly what I was looking for... Points well earned :-]

Regards, Jonny...

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question