سؤال

We'd like to use couple of legacy utilities in our Metro style application. It'd be waste of time trying to recompile and wrap them into WinRT components as they have very simple interfaces.

Is it possible to spawn a child process (which will stay within sandbox) from Metro Style app? Metro style IE seems be able to do it, however as we all know it's "special".

هل كانت مفيدة؟

المحلول

You should be able to package your process as an out-of-proc COM object and use CoCreateInstanceFromApp to launch it.

There are likely to be some challenges related to getting the proxy/stubs for your COM interfaces to work - the low level C++/IDL authoring experience isn't well documented currently so building the proxy/stubs will be difficult, but it absolutely is possible to do.

نصائح أخرى

There is no API in metro like SellExecute or createprocess so you cannot launch other programs as is. You can however use protocol Handlers. A metro app can register a protocol handler, or use existing handlers. Think of http:// or mail:// that launches the default app registered for that handler. You can use custom handler if they are not yet registered ...

CoCreateInstanceFromApp() only allows you to create in process COM classes that are packaged with your app. You need to write an out of process WinRT EXE server. Please see this sample:

http://code.msdn.microsoft.com/windowsapps/Hybrid-app-Exe-server-79bc4bca

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top