Solved

Detecting an automation call

Posted on 2000-05-09
6
136 Views
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...
0
Comment
Question by:jonnyfive
6 Comments
 
LVL 10

Expert Comment

by:Lischke
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
0
 

Author Comment

by:jonnyfive
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...
0
 
LVL 10

Expert Comment

by:Lischke
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...

Mike
0
Independent Software Vendors: 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!

 
LVL 3

Expert Comment

by:smurff
ID: 2796354
Listening.. and hopeing too
0
 

Accepted Solution

by:
apostolost earned 100 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.

Apostolost
0
 

Author Comment

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

Regards, Jonny...
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Tviruailstringtree sort multi columns on header click 1 84
Firemonkey webbrowser scrollbars ? 1 57
DBCtrlGrid, Delphi, Scroll 7 32
Delphi android app hide keyboard 3 39
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

685 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