ReadFile一直讀不到資料,我用vs2013編譯就可以讀到資料,vs2015就讀不到,不知道為什么,求大神指教!
SECURITY_ATTRIBUTES sa;
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
if (!CreatePipe(&g_stdoutPipR, &g_stdoutPipW, &sa, 0))
{
printf("stdout pipe creation failed\n");
return;
}
*stdout = *_fdopen(_open_osfhandle((long)g_stdoutPipW, _O_TEXT), "w");
setvbuf(stdout, NULL, _IONBF, 0);
uj5u.com熱心網友回復:
設定斷點看每一步是否成功?_open_osfhandle 的原型
int _open_osfhandle ( intptr_t osfhandle, int flags )
建議 用
_open_osfhandle((intptr_t )xxx, long 在 64位系統下會被截斷
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/20101.html
標籤:基礎類
上一篇:vs2019新建專案沒有備選項,嘗試過勾選所有和c++有關的選項,顯示安裝完成,但是有警告,之前試過安裝其他版本,也是不行,好慌啊。
下一篇:關于matlab實作多徑效應
