平时c++接触不多,最近从网上下载了一份源码编译,win10+Visual Studio2015,本机编译成功并运行成功,但是拷到其它电脑运行会遇到如下图报错,折腾了挺久最终发现问题在于writefile函数
原函数
WriteFile(g_hChildStd_IN_Wr, command.c_str(), command.size(), null, NULL)
修改为
DWORD dwWritten;
WriteFile(g_hChildStd_IN_Wr, command.c_str(), command.size(), &dwWritten, NULL)