Author: macaroni
Date: 04:08:25 09/24/03
Go up one level in this thread
On September 24, 2003 at 02:22:42, Martin Schreiber wrote:
>I'm sorry. I've forgot to say, that i work with Dev-C++.
Hi, I'm not sure if I understand you correctly (no doubt my fault), what you
want to do, is check if there is something in the pipe before you actually get
it out (otherwise if there isn't the stupid thing waits for the next command).
if so, then there is a relatively straight foward way of doing it. Heres a code
snippet
static HANDLE inh; // declare this globally somewhere
DWORD dh;
if (PeekNamedPipe(inh,NULL,0,NULL,&dh,NULL)) if (dh) // PeekNamedPipe puts the
// number of bytes in the pipe into 'dh', so if (dh) is not equal to zero
// then there is something in the pipe :)
{
cin >> InputMessage;
}
this works fine on mine, i'm not entirly which .h file you have to include, but
I think it's io.h or iostream.h, you should be able to find out.
Hope this is of use to you.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.