From 25b77c1b31b40a72b9567546458f6ca55c0e6857 Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 30 Mar 2012 05:27:10 +0000 Subject: [PATCH] win32-did not mean to check in this hack --- desmume/src/windows/console.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/desmume/src/windows/console.cpp b/desmume/src/windows/console.cpp index 9babcf8e0..005dfaf4e 100644 --- a/desmume/src/windows/console.cpp +++ b/desmume/src/windows/console.cpp @@ -93,14 +93,14 @@ void OpenConsole() HMODULE lib = LoadLibrary("kernel32.dll"); if(lib) { - //typedef BOOL (WINAPI *_TAttachConsole)(DWORD dwProcessId); - //_TAttachConsole _AttachConsole = (_TAttachConsole)GetProcAddress(lib,"AttachConsole"); - //if(_AttachConsole) - //{ - // if(_AttachConsole(-1)) - // attached = true; - //} - //FreeLibrary(lib); + typedef BOOL (WINAPI *_TAttachConsole)(DWORD dwProcessId); + _TAttachConsole _AttachConsole = (_TAttachConsole)GetProcAddress(lib,"AttachConsole"); + if(_AttachConsole) + { + if(_AttachConsole(-1)) + attached = true; + } + FreeLibrary(lib); } //if we failed to attach, then alloc a new console