I still don't know why you want to do this with a thread, if you mind looking at my post above.
But if, this is how to do it:
- place the
query (or whatever fetches the input form the user) in a thread
- after the
query was answered and confirmed by the user, the thread sets a variable "I'm done", places the user input somewhere the main thread has
access to and goes asleep/terminates
- in your main thread, you use
waitforsingleobject to wait until the thread does set this variable, fetch the input and continue your loop.
But unless you have to keep your app doing something else while waiting for the input (which wouldn't work the way I just described it), i don't know why you would want to use a thread here...
EDIT: you don't initialize your "i" in the thread, so it'll probably take a long time until it gets to "3". but I can't see any othermistakes in it.