Some times we cocould want to print the debug messages to a window (console or Windows) or a file, we debug our programms with these information. there's a better way to debug programm, print the message to output window if you use vs, And you can double click the message to locate the source codes. to achive this, you only need:
1.SprintfThe message to format as: _ file _ (_ line _): Message string
2. InvokeOutputdebugstring ()To print the message to ouput window.
Note: For C ++, outputdebugstring () is for printing message into output window; For DOTNET, debug. writeline () is for the same purpose.
Else, you shoshould want to print some messages to output window when compiling, yes you only need:
1. format the message string
# Define stringize (l) # l
# Define makestring (M, L) m (l)
# Define $ line makestring (stringize, _ line __)
# Define reminder (_ S _) _ file _ "(" $ line "):" _ S _
2. Output
# Pragma message (reminder ("aabbccddeeff "))
From: http://blog.csdn.net/sunningPig