Advertisement

TRACE() and Win32

Started by November 23, 2002 11:40 PM
1 comment, last by DJohnson 21 years, 11 months ago
I''ve found that most of my conversations with MFC tend to go something like this: "Hi MFC, I''d like to work on making a game today." "Ohhhh! An office application?" "No, a game. They''re fun." "A game that''s an office application?" "Um, yeah... Hold on a second." So I''ve been trying to move to Win32. Unfortunately I miss MFC''s TRACE function. Is similar debugging function that works in Win32?
Or what? You'll send the dogs? Or the bees? Or the dogs with bees and when they bark they shoot bees at you?
Nope, you'll have to write your own. TRACE is actually a macro that calls the MFC AfxTrace function in a debug build, and does nothing in a release build. AfxTrace formats your text and calls a Win32 API function called OutputDebugString to dump the text string into the output window.

I would start by checking out the OutputDebugString function in the platform SDK, then adding your own functionality as needed. You might also look up the AfxTrace function in the MFC code.

Just thought I'd add this article too...

Using ASSERT(), VERIFY(), and TRACE() in non-MFC Applications


[edited by - mattb on November 24, 2002 1:02:51 AM]
Advertisement
check out thr RPTn macros.

This topic is closed to new replies.

Advertisement