当试图从npapi Chrome插件+ Boost :: process获取异常时启动子进程

时间:2011-05-18 07:39:27

标签: windows exception boost npapi

您好 我有使用FireBreath构建的npapi插件,它的工作正常,我在那里加载 示例插件。现在我希望能够从插件启动外部应用程序 所以我使用这里发现的boost :: process:
boost::process

现在在我的代码中我刚刚在插件代码中输入了一个boost示例,它看起来像这样:

void npapitestAPI::testEvent(const FB::variant& var)
{

     std::string exe = boost::process::find_executable_in_path("hostname"); 
    boost::process::child c = boost::process::create_child(exe); 
    int exit_code = c.wait(); 
#if defined(BOOST_POSIX_API) 
    if (WIFEXITED(exit_code)) 
        exit_code = WEXITSTATUS(exit_code); 
#endif 
    std::cout << exit_code << std::endl; 

    fire_fired(var, true, 1);
}

所以当我从浏览器中移除js方法时我会进入这个方法 但是当我在boost :: process :: create_child(exe)中; 我得到的异常看起来像这样:

npnpapitest.dll!_CxxThrowException(void * pExceptionObject=0x0012e178, const _s__ThrowInfo * pThrowInfo=0x10562d9c)  Line 161   C++
npnpapitest.dll!boost::throw_exception<boost::system::system_error>(const boost::system::system_error & e={...})  Line 61 + 0x53 bytes  C++
npnpapitest.dll!boost::process::behavior::inherit::inherit(void * h=0x00000003)  Line 80 + 0x5a bytes   C++
npnpapitest.dll!boost::process::context::context()  Line 101 + 0x2c bytes   C++
npnpapitest.dll!boost::process::create_child(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & executable="C:\WINDOWS\system32\hostname.exe")  Line 369 + 0x13 bytes C++
npnpapitest.dll!npapitestAPI::testEvent(const FB::variant & var={...})  Line 110 + 0xd bytes    C++

我无法理解这里有什么问题。 谢谢

0 个答案:

没有答案