Solved

Detecting an automation call

Posted on 2000-05-09
6
130 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 3

Expert Comment

by:smurff
Comment Utility
Listening.. and hopeing too
0
 

Accepted Solution

by:
apostolost earned 100 total points
Comment Utility
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
Comment Utility
Wow... thanks... exactly what I was looking for... Points well earned :-]

Regards, Jonny...
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

11 Experts available now in Live!

Get 1:1 Help Now