Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Activex control

Status
Not open for further replies.

liony

Programmer
Jun 3, 2005
3
NL
Hi,

I have a component(not a VCL) which gives samples from a machine whenever there is an event(a new message event). I need to interface this componet to 'Labview' language.

I tried to create a dll, which doesn't work properly, where I cannot handle the event directly from labview.

So I think I need to create a activex control for that already existing component. How can I do that? When I use VCL control vizard, I cannot able to see the component in the list as the component is not a VCL component. Also the activex component must be a descendent of Twincontrol, but in my case it is a descendent of some non-visual component. Please suggest me....

Thanks.

 
Try this

New|Other|ActiveX|ActiveX Library
then
New|Other|ActiveX|Automation Object

A dialog will popup. Give your COM object a name eg. MyWidget. Tip, don't put a T in front of it. Select the Instance and Threading Model. If you need Event Support, click the check box.

The dialog will close and you will have the TLB editor on the screen.

You will now have two files in the IDE Project1.DPR and Unit1.PAS. Unit1.pas will hold the implementation code for your object's interface.

Save Unit1.PAS under its correct name eg. MyWidget_Impl.PAS. Then save the project under its correct name eg. MyWidget.DPR. Now you need to get your TLB editor back to start implementing your interface. Go to File|Open and select the directory where MyWidget.DPR is. There you will find the file MyWidget_TLB.PAS. Open that file and press F11 until the TLB editor comes up. Now you can add your interface methods, properties etc. You need to be careful because the TLB editor is temperamental. There is plenty of information available on how you select parameters for methods etc.

When you are finished, compile your project and Delphi will create a DLL that is a COM object. Your clients will have to register your DLL using REGSVR32 to make the COM interface available on another computer.
 
Hi rfedyk,

I needed to create a activex control for an already existing component. I think the method you explained is for creating a new activeX component.

When I followed the steps you explained I don't know how to use the TLB editor. (I am new to Delphi itself).

I think I need to create an instance of the previously existing component and modify the methods/procedures according to the type where activex control can use. When I create another component with the instance of the existing component, still I cannot able to see in the VCL control wizard

Could you please explain me what should I do inorder to change the existing component to new activex component so that the events can be handled from another Language.

-Liony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top