-
March 14th, 2004, 09:19 PM
#1
Anything like TRACE() available in Win32 ?
Title says it all, folks!
It would help me a lot if there was some way I could send output to the debug windows with this Win32 API project I'm working on.
Thanks, RD
-
March 14th, 2004, 09:57 PM
#2
OutputDebugString()
Regards,
Paul McKenzie
-
March 14th, 2004, 10:22 PM
#3
_RPTx and _RPTFx from the <crtdbg.h> as well.
EDIT: corrected the macro spelling of _RTPFx to _RPTF (wierd I still wanted to write RTP?? NC thing?...ohh yea, while we are on NC...obligated to say...Duke Sucks)
Last edited by Mick; March 15th, 2004 at 01:01 AM.
-
March 15th, 2004, 12:51 AM
#4
Thank you very much for the replies!
-
March 15th, 2004, 08:57 PM
#5
If you use the debugger to single-step a TRACE, you will see that it uses AfxTrace.
AfxTrace calls afxDump.
afxDump is actually CDumpContext::operator<<(LPCTSTR lpsz).
CDumpContext::operator<<(LPCTSTR lpsz) calls CDumpContext::OutputString.
OutputString calls AfxOutputDebugString.
Guess what AfxOutputDebugString calls to write the string?
-
March 16th, 2004, 04:35 AM
#6
Almost all of the debugging report macros can be traced back to finally sending a formatted output string via OutputDebugString(...) I say almost because there are different reporting functinos for kernel mode drivers. The problem is formatting the string first, which is why you have the macros.
Typicall, I use my own logging facility, so I can control what gets logged via a log level enumeration (and use the and use va_arg to format my strings) in conjunction with EventLogging since most consumers want eventlogging capability, I also usually double back that with my own logfiles, because I don't want critical message or crashes (with stack traces) to disappear when someone gets the itch to clear the eventlog. I am then also able to control what the precompiler removes as far as logging, alot of debug type log messages I do not want evaluated at runtime, so I define the calls away so the preprocessor removes them.
Probably more than the OP was looking for but meh
-
March 17th, 2004, 11:31 AM
#7
yeah, build up your own logging code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|