[Lazarus] Threads and Libraries (dll and so)
Marcos Douglas
md at delfire.net
Fri Jan 17 15:06:54 CET 2014
On Fri, Jan 17, 2014 at 10:23 AM, Michael Schnell <mschnell at lumino.de> wrote:
> On 01/17/2014 01:25 PM, Marcos Douglas wrote:
>>
>> is better not use global variables in the DLL.
>
> Of course I agree.
>
> A reason for using global variables in a DLL might be to access that value
> as well in the DLL as in the main program.
>
> Is this even possible ?
Yes, see the Sven Barth answer.
> (To allow for this loading the DLL would need to modify the variable's
> address anywhere within the DLL code. Up til now I only know about the the
> "jump table interface" that allows the main code to call DLL functions. )
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.
Regards,
Marcos Douglas
More information about the Lazarus
mailing list