Solved

Detecting an automation call

Posted on 2000-05-09
6
132 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now