Ahh, great! It works much better now Thank you very much!
Though...i do have one further question now of this new code. That "if(WAIT_TIMEOUT...bla bla", what exactly does it do? Why did it work with the ReadConsoleInput() now? Me feeling stupid... =/
[edited by - Android_s on April 21, 2003 6:00:18 PM]
Console functions
Good question I know how to use it, just not how it works
My guess its some sort of multithreading, but I'm really clueless how it does it.
Jeff D
EDIT: That line tells the program to wait some number of milliseconds for imput if none is given then return.
Also why it works now I believe it was a void function before trying to return is what caused it to not work, making it a function that returned what it did then mowent to your move function worked. I'm somewhat still a newbie in programming as you.
[edited by - Jeff D on April 21, 2003 7:42:50 PM]
My guess its some sort of multithreading, but I'm really clueless how it does it.
Jeff D
EDIT: That line tells the program to wait some number of milliseconds for imput if none is given then return.
Also why it works now I believe it was a void function before trying to return is what caused it to not work, making it a function that returned what it did then mowent to your move function worked. I'm somewhat still a newbie in programming as you.
[edited by - Jeff D on April 21, 2003 7:42:50 PM]
Ahh, ok..hmm...i have to look into that, hmm...
Thanks anyway for the help
[edited by - Android_s on April 22, 2003 7:12:55 AM]
Thanks anyway for the help
[edited by - Android_s on April 22, 2003 7:12:55 AM]
-
if(WAIT_TIMEOUT == WaitForSingleObject(m_hInput, 20)) return;
-
With a call to WaitForSingleObject you instruct the operating system to wait for the given kernel object to become signaled. While waiting for the object the os can shedule another thread for processing time. When the object is signaled the function returns and the calling thread can be sheduled again. In this case the kernel object is a input handle, the object becomes signaled when there is any input pending.
if(WAIT_TIMEOUT == WaitForSingleObject(m_hInput, 20)) return;
-
With a call to WaitForSingleObject you instruct the operating system to wait for the given kernel object to become signaled. While waiting for the object the os can shedule another thread for processing time. When the object is signaled the function returns and the calling thread can be sheduled again. In this case the kernel object is a input handle, the object becomes signaled when there is any input pending.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement