Last active
February 1, 2018 17:41
-
-
Save Fusion86/4afe5867a4fe13e73314638e46679cc1 to your computer and use it in GitHub Desktop.
DBOUT(s) - pick one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C style format (like printf) | |
// Source: http://systools.losthost.org/?code=3 | |
void WINAPIV DBOUT(const TCHAR *fmt, ...) | |
{ | |
TCHAR s[1025] = { 0 }; | |
va_list args; | |
va_start(args, fmt); | |
wvsprintf(s, fmt, args); | |
va_end(args); | |
s[1024] = 0; | |
OutputDebugString(s); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++ style format (like cout) | |
// Source: https://stackoverflow.com/a/1149623/2125072 | |
#include <iostream> | |
#include <sstream> | |
#define DBOUT(s) \ | |
{ \ | |
std::wostringstream os_; \ | |
os_ << s; \ | |
OutputDebugStringW( os_.str().c_str() ); \ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment