|
-
August 21st, 2001, 04:42 AM
#1
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
-
August 21st, 2001, 05:12 AM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|