[solved] ReadConsole
I'm trying to use ReadConsole, but the result is always madness!!
#define MAX_INPUT 256
ReadConsole( hInputConsole, szInput, MAX_INPUT, NULL, NULL );
When i WriteConsole szInput, it just looks like a bunch of =======================================22222 or something. is there something strange to know about ReadConsole, or is there a better Win32 function out there?
SOLVED: the fourth parameter can't be NULL
that helped a bit. i nulled szInput, but it just came out null, so apparently i'm putting something wrong into ReadConsole. i'll try to figure that out.
It looks like ReadConsole() is failing. I believe this is because the lpNumberofCharsRead parameter should not be NULL.
Quote:Original post by Yohomyth
Is there something strange to know about ReadConsole, or is there a better Win32 function out there?
This might not be suited to your program, but whenever I need to use the console, I declare two std::fstreams:
std::ifstream conin("CONIN$");std::ofstream conout("CONOUT$");
Which achieves the same result, but using the STL. It results in me having to do less work, which is always good [grin].
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement