Solved

ActiveX Forms

Posted on 2000-03-25
5
212 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
proper way to parse text with delphi 7 121
Delphi: how to send PJL commands to printer 3 99
How to debug For loops? 3 49
When i run adoquery my application freezes 26 166
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

770 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