Привет
у меня есть плагин npapi, я строю с использованием FireBreath, и он работает нормально, я загружаю туда
образец плагина. Теперь я хотел бы иметь возможность запускать внешнее приложение из плагина
так что я использую 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++
Я не могу понять, что здесь не так.
Спасибо