-
global variables
Hi,
I am using a global variable inside a MFC regular DLL. The problem happens when I close the program. The are hundreds of access violations and points to the destructor of the global variable and "if ( _CRT_INIT(hDllHandle, dwReason, lpreserved) == FALSE )" in DllMain().
Can anybody give me some idea what I should take into account about the global variables in DLL?
thanks in advance
Jessie
-
Re: global variables
Global variable usage is not a good practice of programming but if your variables are pointer, so properly delete them in dll exit application function (Exitinstance) also u can use try...catch block for proper tracing and fixing.
Related keywords:
try...catch
CException class
CMemoryException class
etc.