Captrick458
Programmer
I am from the Unix Environment so have absolutely no experience with Windows and DLLs.
I read somewhere that static variable behave improperly in DLLs because of the shared nature of the DLL. Yet, accroding to Microsoft, each time a process attaches to a DLL, the DLL creates a separate data space.
Imperical testing indicates that static variables regardless of whether defined inside a function or defined at the file level, as well as externals maintain their own version of each variable type. I've only done this with integers, but I assume that the outcome will be the same with other simple as well as complex data types.
If anyone has comments or references on this topic, I would love to hear them.
Thanks in advance, Rick
I read somewhere that static variable behave improperly in DLLs because of the shared nature of the DLL. Yet, accroding to Microsoft, each time a process attaches to a DLL, the DLL creates a separate data space.
Imperical testing indicates that static variables regardless of whether defined inside a function or defined at the file level, as well as externals maintain their own version of each variable type. I've only done this with integers, but I assume that the outcome will be the same with other simple as well as complex data types.
If anyone has comments or references on this topic, I would love to hear them.
Thanks in advance, Rick