I have a MFC project using the shared MFC DLL (MFC140UD.DLL).
I want to set the trace level in my debug version to level 4, to get more information about message pumping.
But using CTrace::SetLevel
in my code, just sets the debug level for the CTrace object in my personal modules (my EXE file). CTrace
ist declared as __declspec(selectany)
. In the exported symbols of the MFC140UD.LIB I can see no export for the class CTrace
or its members.
So using CTrace::SetLevel
has no effect on the MFC core MFC140UD.DLL. I always have to set a breakpoint inside the atltrace.h and need to modify the static m_nLevel value in the debugger.
Is there any trick to access the CTrace::m_nLevel
value inside the MFC core DLL from my outer MFC EXE?
Note: Also the old AtlTraceTool
stuff isn't no longer working and supported.
It should be impossible to access the CTrace::m_nLevel value inside the MFC core DLL from your outer MFC EXE. Each module has its own instance of the CTrace class, that is, you should get the static member variable CTrace::m_nLevel set to the appropiate value in the context of each module. So I'm afraid you cannot configure the trace level in MFC140UD.DLL from your own module when you using the shared MFC DLL.
You can try to call API AtlTraceModifyModule to Set trace level of MFC140UD.dll.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With