[Lazarus] Threads and Libraries (dll and so)

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Jan 17 16:38:24 CET 2014


Marcos Douglas wrote:

> But why do you need a global var in the DLL? IMHO (and for many
> programmers around the world), global var is not good, even in the
> application code.

Although I think that this is in part "received wisdom", dating back to 
some of the earliest ALGOL computers where globals were a comparatively 
scarce resource which couldn't be swapped with the same ease as 
variables on the stack or storage on the heap.

If they really were so unutterably bad, I'd like to think that the 
designers of Delphi would have gone to more trouble to define forms as 
something non-global.

So going back to the specific question, as I understand it you get a 
global in a DLL if you define a form in it. In practical terms it might 
not be immediately usable, but as an example I've used a form in a DLL 
as a template and copied menu entries from it to an appropriate form in 
the main app.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list