[Lazarus] Library, Threads and Gui

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Jun 5 12:49:54 CEST 2012

Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> hat am 5. Juni 2012 um 11:57

> Please can I tack a related question onto this. If I have analogous
> forms in a main program and shared library (.dll or .so), where the menu
> structure in the main form is built up from what's in the library, can
> the main program's menu call OnClick() events in the library safely?
> What I'm hoping to do is use the library's form(s) purely for design
> purposes, i.e. they're never displayed but instead their menu structure
> is copied to the main program. Non-graphical backend functionality would
> be in the library, and I've obviously got the choice of attempting to
> control this using OnClick() etc. or by passing commands in strings to
> be parsed.

An event is just a method pointer (instance+address). So you can connect even a
C library if the method signature fits. Of course not via the designer, but by
code. So, yes you can call pascal functions in libs.

But you have to be careful with all shared things that uses compiler magic like
classes, strings, interfaces, global variables.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120605/dccb063e/attachment-0003.html>

More information about the Lazarus mailing list