Solved

ActiveX Forms

Posted on 2000-03-25
5
215 Views
Last Modified: 2010-04-04
I am trying to develop an application which allows clients to develop their own ActiveX plugins which will appear in my app as form.

I have created an ActiveForm, which resides in test.ocx. In my client app I scan a directory at runtime, and register the test.ocx using LoadLibrary and GetProcAddress(RegisterDLL).

However, Im having problems creating and displaying the form.

When I use CreateOLEObject and (loading the result into an OLEVariant), the function returns an IDispatch interface to my AX form object. This IDispatch has no methods which allow me to show the form.

So my question is, how do I get at my form, from this IDispatch ?
I want to be able to access the underlying form via properties or methods such as Top, Left and Show, ShowModal.

Sample source much appreciated, but a good explanation will earn the points.

Thanks !
0
Comment
Question by:Carpathia
[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
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 2657467
Drop an OleContainer (System tab) on your form.

To load an ActiveX form into the container use this code:

  OleContainer1.AutoActivate := aaManual;
  OleContainer1.CreateObject('XXXXProj1.XXXXX', false);
  OleContainer1.DoVerb(ovShow);

XXXXX is the name of the object.


If you want to access components on the ActiveX form you have to publish your own methods and properties in the Type Library editor.

Eps.
0
 

Author Comment

by:Carpathia
ID: 2657546
Thanks eps. This solves the showing of the form, but still doesnt allow me access to top and left etc..

But Im really looking for a way to take my IDispatch from CreateOLEObject, and get access to the TActiveForm? or at least get hold of some other interface which defines top, left etc.

Thanks
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 150 total points
ID: 2658000
Like I said, you have to publish these properties in the Type Library...
0
 

Author Comment

by:Carpathia
ID: 2658453
thanks :)

I intiially thought your comment about the type library related just to components on the form, not the methods of the form itself.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2661802
Instead of

OleContainer1.DoVerb(ovShow);

mybe you can better use

OleContainer1.Run;


Eps.
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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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