[Lazarus] ActiveX control demo

Roberto Padovani padovani.r at gmail.com
Mon May 30 16:37:50 CEST 2011


Until this morning I was using 0.9.28.3, so I decided that it was time
to upgrade.

After installing lazarus 0.9.30 from sourceforge and opening your demo
I get a missing required package LCL >= 1.0.1.
By default I found the installed package LCL 1.0 and not installed LCL
0.9.30, which I cannot install because it makes conflict with the
other one.

Happened to anyone ?

R#

2011/5/30 Ludo Brands <ludo.brands at free.fr>:
> Dear all,
>
> Attached a demo program that implements a simple solution for embedding
> ActiveX controls in LCL forms.
> It uses atl.dll, part of Active Template Library, the MS C++ COM support
> classes. The dll is part of most (if not all) windows installations and is
> really lightweight (58k on win32, 88k on win64).
> If using MS C++ class helpers is causing "religuous" objections, please
> don't read on ;)
>
> The method used is quite simple:
> - Drop a Tpanel on a form. Could be any visual control but Tpanel is the
> simplest.
> - Start ActiveX control using CreateOleObject (late binding) or
> CoCreateInstance (early binding)
> - call AtlAxAttachControl with Tpanel.Handle and the IUnknown interface of
> the ActiveX object.
> That's it. The ActiveX object is embedded in the Tpanel. Resizing the Tpanel
> at runtime correctly resizes the ActiveX control and setting Tpanel.Visible
> to false will hide the ActiveX control.
>
> I also added the code to implement an event sink for the ActiveX object. The
> demo uses the web browser control. The status bar below the control is
> updated by the event sink.
>
> Important: since the fpc COM implementation has changed quit a lot recently,
> the demo needs a recent fpc to compile and run. So if you get the compiler
> complaining about constref in QueryInterface or if you run into compile or
> run-time errors around Utf8Encode(OleVariant(Params.rgvarg[0])); , update
> the compiler.
>
> Ludo
>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>




More information about the Lazarus mailing list