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

Posted on 2005-04-13
Last Modified: 2010-04-05
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
Question by:Jackson_62
    LVL 13

    Accepted Solution

    here's an article about that:

    basically you create a new ActiveForm, and create your current form inside this new ActiveForm... done

    Author Comment


    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 ?

    LVL 5

    Expert Comment



    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!


    LVL 14

    Expert Comment

    For future reference, a copy of, 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);
          // 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:

          TActiveForm1 = class ...
          ChildForm: TForm1;
       6. Compile and test your form.
    LVL 14

    Expert Comment

    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.

    EE Cleanup Volunteer

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
    This video discusses moving either the default database or any database to a new volume.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    758 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

    12 Experts available now in Live!

    Get 1:1 Help Now