Skip to content

Instantly share code, notes, and snippets.

@Fusion86
Last active February 1, 2018 17:41
Show Gist options
  • Save Fusion86/4afe5867a4fe13e73314638e46679cc1 to your computer and use it in GitHub Desktop.
Save Fusion86/4afe5867a4fe13e73314638e46679cc1 to your computer and use it in GitHub Desktop.
DBOUT(s) - pick one
// 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);
}
// 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