_wspawnlp()函数在server08上使用问题
server08 应该是基于win7的吧,这个函数我在xp+sp3上用的很好,
但是换了环境后程序就崩溃了,加了好多库还是不管用,
请问可能是什么问题?代码如下:
#include <process.h>
#include <wchar.h>
...
_wspawnlp( _P_WAIT, L"notepad", NULL );
问题肯定是发生在这的、、
[解决办法]
...居然还有人在用spawn...楼主希望调用者阻塞直到notepad结束?
[解决办法]
[解决办法]
CreateThread,然后Wait线程的handle,即等待线程结束。
[解决办法]
http://support.microsoft.com/kb/125213/en-us
http://support.microsoft.com/kb/125212/EN-US
看看这两篇文章。
There is no way to perform the synchronous spawn with the spawn family of functions on Win32s. You can only perform an asynchronous spawn.
[解决办法]
...这个...需要你给他科普一下了...