| OLD | NEW |
| 1 /* | 1 /* |
| 2 Macros CONSOLE, CONSOLE_WARN, CONSOLE_ERROR are used for Console output | 2 Macros CONSOLE, CONSOLE_WARN, CONSOLE_ERROR are used for Console output |
| 3 CONSOLE_WAIT waits for user to hit Enter | 3 CONSOLE_WAIT waits for user to hit Enter |
| 4 In order to see Console output macro USE_CONSOLE should be defined before Cons
ole.h is included. | 4 In order to see Console output macro USE_CONSOLE should be defined before Cons
ole.h is included. |
| 5 Since Console.h is added in PluginStdAfx.h, then 2 ways to log in Console oupu
t: | 5 Since Console.h is added in PluginStdAfx.h, then 2 ways to log in Console oupu
t: |
| 6 1. Uncomment "#define USE_CONSOLE" in PluginStdAfx.h - Console ouput will be a
vailable in all files. | 6 1. Uncomment "#define USE_CONSOLE" in PluginStdAfx.h - Console ouput will be a
vailable in all files. |
| 7 2. Add "#define USE_CONSOLE" as very first line of a cpp file - Console ouput
will be available in this file | 7 2. Add "#define USE_CONSOLE" as very first line of a cpp file - Console ouput
will be available in this file |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #pragma once | 10 #pragma once |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 { | 28 { |
| 29 ConsoleWaitReturn(){} | 29 ConsoleWaitReturn(){} |
| 30 ~ConsoleWaitReturn() | 30 ~ConsoleWaitReturn() |
| 31 { | 31 { |
| 32 if (s_hasError) | 32 if (s_hasError) |
| 33 { | 33 { |
| 34 CONSOLE("Hit 'ENTER' to exit"); | 34 CONSOLE("Hit 'ENTER' to exit"); |
| 35 | 35 |
| 36 HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE); | 36 HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE); |
| 37 | 37 |
| 38 » » » TCHAR buf[128]; | 38 » » » wchar_t buf[128]; |
| 39 DWORD nRead = 0; | 39 DWORD nRead = 0; |
| 40 ReadConsole(hInput, buf, countof(buf), &nRead, 0); | 40 ReadConsole(hInput, buf, countof(buf), &nRead, 0); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 } static s_ConsoleWaitReturn; | 43 } static s_ConsoleWaitReturn; |
| 44 | 44 |
| 45 DWORD lastError = GetLastError(); | 45 DWORD lastError = GetLastError(); |
| 46 | 46 |
| 47 if (eError == code) | 47 if (eError == code) |
| 48 { | 48 { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 { | 146 { |
| 147 InterlockedIncrement(&g_consoleCount); | 147 InterlockedIncrement(&g_consoleCount); |
| 148 | 148 |
| 149 va_list args; | 149 va_list args; |
| 150 va_start(args, format); | 150 va_start(args, format); |
| 151 WritelnToConsole(eLog, g_consoleCount, format, args); | 151 WritelnToConsole(eLog, g_consoleCount, format, args); |
| 152 va_end(args); | 152 va_end(args); |
| 153 } | 153 } |
| 154 | 154 |
| 155 CONSOLE("Hit 'ENTER' to continue"); | 155 CONSOLE("Hit 'ENTER' to continue"); |
| 156 » TCHAR buf[128]; | 156 » wchar_t buf[128]; |
| 157 DWORD nRead = 0; | 157 DWORD nRead = 0; |
| 158 ReadConsole(GetStdHandle(STD_INPUT_HANDLE), buf, countof(buf), &nRead, 0
); | 158 ReadConsole(GetStdHandle(STD_INPUT_HANDLE), buf, countof(buf), &nRead, 0
); |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 #else | 162 #else |
| 163 int RemoveConsole(...); | 163 int RemoveConsole(...); |
| 164 | 164 |
| 165 #define CONSOLE sizeof RemoveConsole | 165 #define CONSOLE sizeof RemoveConsole |
| 166 #define CONSOLE_WARN sizeof RemoveConsole | 166 #define CONSOLE_WARN sizeof RemoveConsole |
| 167 #define CONSOLE_ERROR sizeof RemoveConsole | 167 #define CONSOLE_ERROR sizeof RemoveConsole |
| 168 #define CONSOLE_WAIT sizeof RemoveConsole | 168 #define CONSOLE_WAIT sizeof RemoveConsole |
| 169 #endif | 169 #endif |
| 170 | 170 |
| OLD | NEW |