diff options
| author | jhurst <jhurst@cinecert.com> | 2011-03-05 18:55:36 +0000 |
|---|---|---|
| committer | jhurst <> | 2011-03-05 18:55:36 +0000 |
| commit | cb3d6d3ded4b86b903fbf734b41cdee883b335d7 (patch) | |
| tree | 46f57d096783b768430ccd5fc497f4b85a9a2e8b /src/KM_log.cpp | |
| parent | 983f669649dffe348c34da49fdc58ca584707b08 (diff) | |
I hate win32
Diffstat (limited to 'src/KM_log.cpp')
| -rwxr-xr-x | src/KM_log.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/KM_log.cpp b/src/KM_log.cpp index 43f767a..ae152b0 100755 --- a/src/KM_log.cpp +++ b/src/KM_log.cpp @@ -116,6 +116,8 @@ Kumu::StdioLogSink::WriteEntry(const LogEntry& Entry) #ifdef KM_WIN32 // +// http://www.codeguru.com/forum/showthread.php?t=231165 +// void Kumu::WinDbgLogSink::WriteEntry(const LogEntry& Entry) { @@ -125,7 +127,20 @@ Kumu::WinDbgLogSink::WriteEntry(const LogEntry& Entry) if ( Entry.TestFilter(m_filter) ) { Entry.CreateStringWithOptions(buf, m_options); - ::OutputDebugString(buf.c_str()); + int lenW = ::MultiByteToWideChar(CP_ACP, 0, buf.c_str(), buf.size(), 0, 0); + + if ( lenW > 0 ) + { + // Check whether conversion was successful + BSTR unicodestr = ::SysAllocStringLen(0, lenW); + ::MultiByteToWideChar(CP_ACP, 0, buf.c_str(), buf.size(), unicodestr, lenW); + ::OutputDebugString(unicodestr); + ::SysFreeString(unicodestr); + } + else + { + ::OutputDebugString(L("MultiByteToWideChar failed, log sink output discarded.\n")); + } } } #endif |
