Author: macaroni
Date: 17:54:32 09/25/03
Go up one level in this thread
A few things could be the problem. First, how are you testing it? it will only work that way if your actually using a pipe (i.e, testing from arena, winboard or something), it won't work in a bare console (i'm not actually sure what the command for that is). Secondly, that won't actually do what you want it to do. The function returns true if it succeeds, not if there is actually something in the pipe, the correct statement should be: if (PeekNamedPipe(inh,NULL,0,NULL,&dh,NULL)) if (dh) this means, that if the function succeeds, then check to see if dh is non zero, if so, then there are charactures in the pipe, so it's safe to do your cin command. hope this works.
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.