Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to use TRACE() in Win32 Applications

How to use TRACE() in Win32 Applications

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingquestionc++tutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LiYS
    wrote on last edited by
    #1

    Hi all: How can I get debug information through TRACE() or other similar macro in Win32 applications? I added TRACE() in the source code and also include the "AFX.h".In the project setting I choose the "use MFC in a static library"? But it cannot pass the compilation!

    R M D 3 Replies Last reply
    0
    • L LiYS

      Hi all: How can I get debug information through TRACE() or other similar macro in Win32 applications? I added TRACE() in the source code and also include the "AFX.h".In the project setting I choose the "use MFC in a static library"? But it cannot pass the compilation!

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      The nearest equivalent would be to use AllocConsole() and write any debug strings to its handle. I have used this method in the past If you vote me down, my score will only get lower

      1 Reply Last reply
      0
      • L LiYS

        Hi all: How can I get debug information through TRACE() or other similar macro in Win32 applications? I added TRACE() in the source code and also include the "AFX.h".In the project setting I choose the "use MFC in a static library"? But it cannot pass the compilation!

        M Offline
        M Offline
        Martin Koorts
        wrote on last edited by
        #3

        Hi Including gives you; _RPT0, _RPT1 .. _RPT4, _ASSERT, et al These are the primitives of TRACE and ASSERT. I always use it like so, for example; _RPT1(_CRT_WARN, "## blah = '%ls'\n", sz); HTH Martin

        1 Reply Last reply
        0
        • L LiYS

          Hi all: How can I get debug information through TRACE() or other similar macro in Win32 applications? I added TRACE() in the source code and also include the "AFX.h".In the project setting I choose the "use MFC in a static library"? But it cannot pass the compilation!

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Have you considered OutputDebugString()?


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups