MFc调用 _popen()函数,打开外部程序后,界面假死

yskshift 2014-12-01 03:20:54
MFc调用 _popen()函数,打开外部程序后,界面假死
代码如下:

void Gnuplot::init()
{
m_sGNUPlotFileName = "pgnuplot.exe";
if (!this->get_program_path(m_sGNUPlotFileName))
{
this->valid = false;
throw GnuplotException("Can't find gnuplot in your PATH");
}

this->gnucmd = _popen(m_sGNUPlotFileName.c_str(),"w");
if (!this->gnucmd)
{
this->valid = false;
throw GnuplotException("Couldn't open connection to gnuplot");
}
this->nplots = 0;
this->valid = true;
}


请问如何不改动这种方法(_popen())的情况下,使得mfc界面不假死
...全文
322 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
oyljerry 2014-12-02
  • 打赏
  • 举报
回复
用ShellExecute等其他API呢。
lx624909677 2014-12-01
  • 打赏
  • 举报
回复
首先你要判断是因为什么造成的界面假死,如果代码没有问题,那么就把这段代码写在另外一个线程里

15,473

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧