【发布时间】:2013-01-10 17:47:37
【问题描述】:
我正在使用 C++ 处理文件。 我在系统提示符下调用一个程序来创建一个 txt 文件。然后我使用 C++ 读取该文件。 在读取文件之前,我需要确保 C++ 等待程序完成。
C++解释:
createOutputFile();
system("Start wp/PRO386W.EXE /V1 consult('wp/read.pl').");
// I need to wait for this "PRO386W.EXE to finish
readLista();//before calling this method
【问题讨论】:
-
使用
CreateProcess而不是system(),你可以等待返回的句柄。