![](https://csdnimg.cn/release/download_crawler_static/87330844/bg5.jpg)
}
else
{
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
}
void CFatherView::OnRead()
{
// TODO: Add your command handler code here
char buf[100];
DWORD dwRead;
if(!ReadFile(hRead,buf,100,&dwRead,NULL))
{
MessageBox("读取数据失败!");
return;
}
MessageBox(buf);
}
void CFatherView::OnInput()
{
// TODO: Add your command handler code here
char buf[]="你好,我是父进程!";
DWORD dwWrite;
if(!WriteFile(hWrite,buf,strlen(buf)+1,&dwWrite,NULL))
{
MessageBox("写入数据失败!");
return;
}
}
#######################子进程代码#######################