Solved

ActiveX Forms

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month9 days, 3 hours left to enroll

615 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