Board index » cppbuilder » Derive ActiveX control from VCL component...

Derive ActiveX control from VCL component...

Hi,

Just a simple question; why can some VCL components be ancestors of ActiveX
controls and others can't? I wrote a useful VCL component and would like to
make it an ActiveX control (preferably without an ActiveForm...).

Thanks,
Walter Goulet

 

Re:Derive ActiveX control from VCL component...


Quote
Walter Goulet <wgou...@bellsouth.net> wrote in message
> Just a simple question; why can some VCL components be ancestors of
ActiveX
> controls and others can't?

The ActiveX Control Wizard only builds from controls that are based on
TWinControl or its descendents. However, it excludes base classes such as
TCustomControl.

Quote
>I wrote a useful VCL component and would like to
> make it an ActiveX control (preferably without an ActiveForm...).

If your VCL component is based on TWinControl or one of its descendents AND
you have installed it, the ActiveX Control Wizard will show your VCL
component as a selection in it's list of Controls.

It will automatically generate ActiveX properties, methods, and events
matching the ones in your custom VCL component (well, at least the easy
ones). Very cool!

You can even descend your control from the base classes such as
TCustomControl and the Wizard will recognize it.

-- Dave

Re:Derive ActiveX control from VCL component...


: "Walter Goulet" <wgou...@bellsouth.net> wrote:

Quote
>Just a simple question; why can some VCL components be ancestors of ActiveX
>controls and others can't?

Because ActiveX controls need a window control - hence all controls that
descend from TWinControl can be made ActiveX controls directly.

--
Stefan Hoffmeister (TeamB)     http://www.econos.de/
Please do apply judgement when sending email.

Other Threads