[fpc-pascal] Re: Library callback : how do I do that?

Lukasz Sokol el.es.cr at gmail.com
Fri Aug 9 11:32:19 CEST 2013


On 09/08/13 08:28, Michael Schnell wrote:
> On 08/08/2013 02:41 PM, Lukasz Sokol wrote:
>> Very well then, thanks :)
> 
> I suggest that - to exclude problems that might be imposed by some
> external non-Lazarus and software not by yourself  - you do a test
> creating a combination of a Lazarus Application and a Lazarus-made
> dll (and/or so) that features a TThread in the dll and uses
> Application.QueuAsyncCall(Form1.DisplayCallFromDLL, NIL) to display
> some running counter or similar stuff.
> 
> I understand for this you need to - unify the Heaps of Application
> and dll - do a call to the dll to provide the Application and the
> Form1 main form instances of the calling  program
> 
> If you succeed in doing a really reliable Test implementation of
> this, I would be happy to see the source code.
> 
> This could be the basis of a "standard" implementation of something
> similar to Delphi runtime packages.
> 
> Thanks, -Michael 

I, erm, second what Sven and Henry have said - I am not creating my 
own library, but merely trying to build a wrapper...

(OT) (On a side note to the runtime packages, some years ago I had to
look for and indeed I came on someone's 'plugin system' for delphi (7) 
that ran with .dll (as opposed to .bpk where it usually is possible) 
and could add forms to your main application at runtime... needless to 
say, it was a paid-for (and IIRC with NDA attached) system; 
But I was /under impression/ that it would be as easy as having
same memory/heap manager instance for main program and for dll 
(of which some were open source), and that was the main hurdle too,
and passing the Application instance into it by using some Interfaces, 
and the dll capabilities back in the same manner; 
but before I had time to get /less/ inept on Interfaces, the demand
 for this feature has ended... 
so I can't really remember anything else out of that area, sorry.

[Also it may all be rubbish what I wrote, t'is only what I remember of
my impressions, only... I don't have any hard data of this saved anywhere
(my then-employer was really insisting on not taking this work home)...] )

-L






More information about the fpc-pascal mailing list