[Help] consoles.
I was trying to allocate a console in a DLL using AllocConsole() and write to it using WriteConsole(), for some odd reason it prints question marks and some random letters. Could this be caused by the fact that I'm injecting the DLL into another process?
Lol, this is such a fail |:
code:
[PHP]
#include <windows.h>
#include <iostream>
void Say()
{
std::string Buf = "Test";
AllocConsole();
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsole(handle,Buf.c_str(),Buf.length(),NULL, NULL);
}
bool __stdcall DllMain(HINSTANCE hinst,DWORD reason,void* reserved)
{
if(reason == DLL_PROCESS_ATTACH)
{
Say();
}
return true;
}
[/PHP]
Output:
[php]
?t ?? //something like that
[/php]
Why is it doing this to me?
