Hi,
I have a dll which is called by an application I have no control over. It loads my dll and calls the appropriate functions I've exported. I have logging to a file, but I would also like some console logging to view in real time as the app runs. So I have this in my code:
Code:
double myfunction( const char* stuff)
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTitle("New Title");
char test[] = "writing....\n";
int x = WriteConsole(hConsole, test, lstrlen(test), &cChars, NULL);
}
When my function is called, the main applications consoles title bar changes to "New Title" as I have specified. However, the bit of text I have written isn't coming up. I suspect the handle I have is wrong, can anyone help me here? Also, is there an easier API I can use? I thought printf would just write to the std output but that doesn't seem to work either. (which leads me to believe I'm writing to the wrong stream)