[DUG] creating an ActiveX object

Phil Middlemiss phil at tumonz.co.nz
Fri Jun 23 14:25:15 NZST 2006


Well Phil, the thing you need to do is this:

- Descend your component from TCustomControl (or TWinControl) even 
though it is non-visual.
- Register it on the component pallete
- Create a new ActiveX library project
- Create a new ActiveX control based upon your component
- Modify the second to last parameter in the Factory.Create call (in the 
initialization section) to OLEMISC_INVISIBLEATRUNTIME
- Save and compile the project
- Select "Run|Register ActiveX Server".

Simple.

BTW, you could have worked this out if you had done a bit more searching 
on Google groups.

Phil.

Phil Middlemiss wrote:
> I have written a component that implements the event callbacks for the 
> TUMONZ SDK automation object. It manages creating the CoClass and 
> hooking up events. It is descended from TControl since there is no 
> visual aspect to it (it just interacts with the automation object). I 
> want to wrap this up in such a way that other developers can simply 
> bring in the control and start using it. I'm quite happy to distribute 
> a .dcu (hell, even a .pas), but I really want it to be cross-language. 
> I'm using Delphi 6 Pro.
>
> This is where I'm getting confused with my ActiveX terminology. I 
> thought I would create a new ActiveX object, but I can't since the 
> wrapper is a TControl, not a TWinControl.
>
> I want to end up with a control that can be imported into most of the 
> common languages and plonked on a form for events to be hooked up to.
>
> Should I be able to handcraft an ActiveX object for my wrapper? I 
> could distribute the type library, but the wrapper does all sorts of 
> nice things and wraps up connections and events seemlessly.
>
> Any ideas?
>
> Cheers,
> Phil.
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phil.vcf
Type: text/x-vcard
Size: 250 bytes
Desc: not available
Url : http://ns3.123.co.nz/pipermail/delphi/attachments/20060623/25c2df4b/phil.vcf


More information about the Delphi mailing list