110,571
社区成员
发帖
与我相关
我的任务
分享
char szBuf1[4096];
memset(szBuf1,0,4096);
DWORD dwCount=0;
while(IsWork)
{
dwCount=0;
WriteFile(hWrite_in,pCmd->in,sizeof(pCmd->in),&dwCount,NULL);
while(1)
{
dwCount=0;
//while(dwCount==0)
//{
// PeekNamedPipe(hRead_out,szBuf1,4095,&dwCount,NULL,NULL);
//}
if(!ReadFile(hRead_out,pCmd->out,pCmd->sizeOut-1,&dwCount,NULL))//这里当getchar()时候无声息退出,导致整个while(IsWork)中断
break;
pCmd->out[dwCount-1]=0;
}
Sleep(200);
}