MFC dlls TRACE(debug) messages in WInForm(C#)


  • I'm using MFC extended dll in my WinForm(C#) project as a managed C++(C/C++ CLI).

    However, some methods didn't work as I expected. So, I asked the MFC developer to put some debugging TRACE messages so I could trace them.

    The question is where could I see those TRACE messages from MFC dll? I've checked both console and degug output but no messages at all.

    Or, is this technically wrong approach?


    Thanks in advance.


    • Moved by Larcolais Gong Monday, February 21, 2011 6:15 AM (From:Visual C# General)
    Friday, February 18, 2011 9:22 AM

All replies

  • This is probably more of a C++/MFC question, but let me take a stab at it.  Is the DLL in a debug or release build?  The trace statements are removed during a release build.
    Friday, February 18, 2011 11:22 PM
  • Hi Choyee,

    I'll help you moving your thread into MFC forum. You will get more helpful suggestions there.

    Best Regards,


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 21, 2011 6:14 AM
  • You could use DbgView. This is one of the great Sysinternals tools. DbgView shows the TRACE messages.
    Monday, February 21, 2011 6:54 AM
  • TRACE is only active in _DEBUG builds. are you sure that you are using a _DEBUG build? Also, in case of such problems, you should just turn on unmanaged code debugging and look for yourself (that of course needs sources). Alternatively, MFC developer can debug through your calls on his side, too.
    Monday, February 21, 2011 7:52 AM
  • Since DLL is compiled with CLR support, you can ask the developer to add a reference to System.DLL and use System::Diagnostics::Trace::WriteLine or System::Diagnostics::Debug::WriteLine instead of TRACE.


    Or go to Properties dialog of your main application, to Debug tab, and check “Enable unmanaged code debugging”.

    Tuesday, February 22, 2011 6:59 AM