[fpc-devel] Import typelib extension
Ludo Brands
ludo.brands at free.fr
Fri Dec 30 13:54:56 CET 2011
Hi all,
I'm in the middle of adding to the typelib importer the automatic generation
of a component implementing a sink for the events created by the com object.
It'll use the EventSink object I wrote a while ago and will generate the
components Onxxx properties and the corresponding function signatures. This
will remove the burden of mapping dispids, retrieving and converting
parameters to fpc compatible types (VT_BYREF !), etc. This is all fpc and
would fit in with the current implementation of importtl.pas and
typelib.pas.
However, I just wrote a freepascal implementation of an Ole container
(visual ActiveX container) and I would obviously like to integrate this also
with the typelib importer to create also a complete (visual) component from
an ActiveX typelib, including its event handlers and eventually the lpk to
install the component in Lazarus. The Ole container is a descendant of
TWinControl and obviously LCL.
Comes my question: I would like to put the EventSink and the Ole container
in a "OleComponents" unit in the winunits-base package to avoid a
multiplication of units and directory paths. Is the use of {$ifdef LCL} to
encapsulate the Ole container in a fpc unit acceptable or is this a herecy?
The unit created by the typelib importer would also have parts inside
{$ifdef LCL}
Ludo
More information about the fpc-devel
mailing list