Is it possible to create an activex COM wrapper around a current EXE application

We are utilizing a new development product (LANSA) and we would like to call up our existing DELPHI applications within the framework.  Because it is currently an EXE application, it only brings up a new window with the application.  Our consultant tells us that if we can create a COM activex wrapper around the application, we could call it within the framework (basically like a browser).

is this possible without beating the heck out of the current application - basically make it seamless to the existing product

any help would be greatly appreciated
Jackson_62Asked:
Who is Participating?
 
BlackTigerXCommented:
here's an article about that:

http://pweb.netcom.com/~cherrman/cvtforms.htm

basically you create a new ActiveForm, and create your current form inside this new ActiveForm... done
0
 
Jackson_62Author Commented:
Blacktigerx

so even though this is one big MDI application , we can encapsulate this ina new parent form and thus be able to call the application from within the browser ?

0
 
VoodoomanCommented:

Hi

Just watching, I know what BTX is saying but there are lots of problems around all this - not the least that msgboxes and modal forms don't work because IE allows them to drop behind the browser when the browser gets the focus.

Comment only - interested watcher!

Voodooman

0
 
cwwkieCommented:
For future reference, a copy of http://pweb.netcom.com/~cherrman/cvtforms.htm, in case it is not available in the future:

Converting a standard Delphi Form to an ActiveForm

By Conrad Herrmann, 25 July 1997

People ask me this question often, and there are several techniques that can do this. The technique that I prefer is easy to learn and the most flexible. In this technique, you make your existing Delphi form a child window of an otherwise ActiveForm. Because it’s a child form, you’ll have to add code to set some of its properties to reflect that fact—to remove the window frame, to align it to its parent’s client area, etc.

This approach has several advantages. The first advantage is that its easy to get up and running—the only thing you need to do that’s not already done for you is to add code to create and embed your form in the ActiveForm. Another advantage is that unlike copying your code to the ActiveForm’s implementation file, this approach doesn’t change your form’s implementation at all. The code you’re familiar with is still familiar. It also means the form’s implementation unit can still be included in a regular Delphi application if you so desire.

Steps to convert a Delphi form to an ActiveForm:

   1. Create a blank ActiveForm.
   2. In the form’s property inspector, add an Create handler like the one shown below:


      Procedure TActiveForm1.FormCreate(Sender: TObject);
      begin
      // This code creates a child form that is just a normal
      // Delphi TForm.
      // This allows the form to be shown both as a normal
      // VCL form and as an ActiveForm.
      ChildForm := TForm1.Create( Self );
      ChildForm.Parent := Self;
      ChildForm.Align := alClient;
      ChildForm.BorderStyle := bsNone;
      ChildForm.Visible := True;
   3. end; In the uses clause, add a reference to your form’s unit (in this case, Unit1).
   4. Add the form’s implementation unit to the project (in this case, Unit1.pas).
   5. Add the declaration of ChildForm to your TActiveForm1 class, like this:


      type
      TActiveForm1 = class ...
      ....
      public
      ChildForm: TForm1;
      ....
      end;
   6. Compile and test your form.
0
 
cwwkieCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: BlackTigerX {http:#13775558}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

cwwkie
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.