开发者

When trying to start child process from npapi Chrome plugin + Boost::process getting exception

Hi i have npapi plug in i build using FireBreath and its working just fine , i loading there sample plugin . now i like to be able to start external application from witin the plugin so im using the boost::process found here :

boost::process

now in my code i just entered one of the boost examples into the plugin codeand its looks like this :

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);
}

so when i triger js method from the browser im entering to this method but then when im in boost::process::create_child(exe); im getting exception that looks like this :

npnpapitest.dll!_CxxThr开发者_如何学PythonowException(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++

i can't understand what is wrong here . Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜