Help with parellel input and ouput.

Im creating a simple chat program in C++ with a DLL called "39dll"
When you type something, obviously, it gets sent to whoever else is connected to the main server.

BUT, because the input and output had to be on different threads (Because getinput() pauses the game, which stops any input from another client from getting printed), anyways, heres an example of my problem, then ill try to explain it :S

Player one starts typing (But doesn't hit enter)
>Hello My name i

Player two starts typing
>Hey man.
Player two hits enter.

Player one's screen screws up because of the new input that got added (While he was still typeing)
So player1's input looks like this now.
>Hello My name iHey man.
>


So, the output one thread 1 interupts the input on thread 2, if you are typing.

I was thinking of trying to find a code, that copys the current cint (Without enterting it)
Than doing the ouput, than posting the temp cin back in lace.

Or somehow making cout push cin infront of it.
Last edited on
Or have separate areas for input and output..
You should make a window with a GUI, and a special input box, in which it will be typed in, and an output box, where the output will be, so it's OK.
OK it seems that i can't use '39dll' with the WIn32 program, so i need a way to do it in the console.

Seperate areas?? how do i do this, .. in the console -.-
Last edited on
Topic archived. No new replies allowed.