Board index » delphi » Automating an existing app

Automating an existing app

I have an existing Delphi 3 app, which normally auto-creates its main form.
I've added an Automation Object which containing a method that contains a
single showmessage statement.

I can fire off the app now as an out-of-process server and call the
automation object's method, but when the OK on the showmessage dialog is
clicked, the app disappears. The main form is not apparently not created,
certainly not shown.

This is tough to debug, because I can't start the server in the IDE and see
what happens when I start the server via automation.

I tried copying the "Application.CreateForm" and "Application.Run" to the
automation object's method, and while this causes the main form of the
application to appear and to otherwise behave normally, the client app's
main form is inaccessible (I guess it's waiting on the automation object's
method to return?) and when I try to close the server, I get the (apparently
dreaded) automation warning.  It also didn't seem like this would be the
regulation approach.

I can't really control the client app, since I want this to be invokable
from VB.

This is obviously my first feeble attempt to use COM...  help would be
appreciated.

 

Re:Automating an existing app


OK, I figured out what I was doing; I was using a button click event to call
CreateOLEObject, with a local variant, which immediately went out of scope,
shutting down the server.

Like I said, I'm real new at this...

Quote
Robert Shanbaum wrote in message <76svcr$a...@forums.borland.com>...

Other Threads