我有一个DLL,我使用AllocConsole()和cout来显示数据以进行调试.
它曾经工作正常但是因为我将我的编译器(Visual Studio 2012)更新到最新的dll只显示控制台而不是print/couts.
我不明白为什么会发生这种情况.
有任何想法吗?
我的部分代码
__declspec(dllexport) INT APIENTRY DllMain(HMODULE hDLL, DWORD Reason, LPVOID Reserved)
{
switch(Reason)
{
case DLL_PROCESS_ATTACH:
AllocConsole();
DisableThreadLibraryCalls(hDLL);
//
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&)pSend, MySend);
if(DetourTransactionCommit() == NO_ERROR)
cout << "[" << MySend << "] successfully detoured." << endl;
Run Code Online (Sandbox Code Playgroud)
但是什么都没有显示