Re: explicit extension DLL wreaking havok during AfxFreeLibrary
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 07/07/04
- Next message: aualias: "Re: How do I cancel window creation in OnInitDialog()?"
- Previous message: Joseph M. Newcomer: "Re: What's Up with this Spin Control?"
- In reply to: Doug: "explicit extension DLL wreaking havok during AfxFreeLibrary"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 07 Jul 2004 12:42:55 -0400
Well, this is a bit odd. For one thing, there IS no "runtime class table"; the
RUNTIME_CLASS macro actually reaches into the class's private storage area to get the
information. So there isn't any one place that can be damaged that can cause this (go read
the RUNTIME_CLASS macro in afx.h: it is one line of code that returns the address
#define RUNTIME_CLASS(class_name) ((CRuntimeClass *)(&class_name::class##class_name))
so there is no way this simple macro could be made to fail after the AfxFreeLibrary.
Defining "fail" would help, of course. Wrong value? Access fault? Can you show an example
of the failing code?
joe
On Tue, 6 Jul 2004 17:17:13 -0400, "Doug" <nospam@nospam.com> wrote:
>For some reason, my extension dll -- which is explicitly loaded by my main
>application -- frees up my entire application's runtime class table (!?) if
>I call AfxFreeLibrary to close it. The very next attempt by my application
>after freeing the DLL to get CRuntimeClass info by name of ANY of my main
>application's classes will fail.
>
>Whats up? Should we not free extension dlls that are explicitly linked?
>The DLL loads and works fine.
>
>Any insight would be greatly appreciated!
>
>btw, my extension dll project defines _AFXEXT and my main MFC app defines
>_AFXDLL.
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: aualias: "Re: How do I cancel window creation in OnInitDialog()?"
- Previous message: Joseph M. Newcomer: "Re: What's Up with this Spin Control?"
- In reply to: Doug: "explicit extension DLL wreaking havok during AfxFreeLibrary"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|