Solved

Detecting an automation call

Posted on 2000-05-09
6
140 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 15 hours left to enroll

628 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