Solved

ActiveX Forms

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

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…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

18 Experts available now in Live!

Get 1:1 Help Now