【发布时间】:2010-08-23 15:33:10
【问题描述】:
fSuccess = ReadFile(
hPipe, // pipe handle
chBuf, // buffer to receive reply
BUFSIZE*sizeof(TCHAR), // size of buffer
&cbRead, // number of bytes read
NULL); // not overlapped
如果不安全,如何确保在windows中读取管道时对方不写?
【问题讨论】:
-
读/写 TCHARS 肯定不安全。因为另一端有不同的进程,它可能会在打开或关闭 unicode 的情况下进行编译。
标签: c++ winapi communication pipe