locked
How do I call a COM interface from a Metro App?

    Question

  • Is there a way to call COM interfaces from my Metro App? I want to access the File History API.
    Thursday, July 12, 2012 11:55 PM

Answers

  • The File History API are available only to desktop apps. They cannot be called from Metro style apps.

    You call COM API from C++ or C# in Metro style apps the same way you would do so from desktop apps. The only major difference is that you cannot instantiate arbitrary COM objects from a Metro style app. There are limited system COM objects available and any custom COM objects need to be included in your appx package and instantiated via registration free COM.

    --Rob

    Monday, July 16, 2012 4:29 AM
    Owner
  • Metro style apps cannot call arbitrary COM objects. In particular, the File History API is documented as being available to desktop apps on.

    There is no way to coerce an object or API which is not available to Metro style apps to be called from a Metro style app. COM objects which are available to Metro style apps (either because they are on the approved list of system COM objects or because they are included in your package via registration free COM) are called the same way those objects would be called from any application.

    --Rob

    Monday, July 16, 2012 5:12 PM
    Owner

All replies

  • Which Language would you prefer to code in?  C++, C#, JavaScript or VB?
    Friday, July 13, 2012 12:35 AM
    Moderator
  • Is there a way to call COM interfaces from my Metro App? I want to access the File History API.
    I also need solution for this problem ,  I can use both C# and C++.
    Sunday, July 15, 2012 6:50 PM
  • The File History API are available only to desktop apps. They cannot be called from Metro style apps.

    You call COM API from C++ or C# in Metro style apps the same way you would do so from desktop apps. The only major difference is that you cannot instantiate arbitrary COM objects from a Metro style app. There are limited system COM objects available and any custom COM objects need to be included in your appx package and instantiated via registration free COM.

    --Rob

    Monday, July 16, 2012 4:29 AM
    Owner
  • I would like to use c#. I thought there was a way to wrap a COM object so that it could be exposed to Metro Apps?
    Monday, July 16, 2012 5:02 PM
  • Metro style apps cannot call arbitrary COM objects. In particular, the File History API is documented as being available to desktop apps on.

    There is no way to coerce an object or API which is not available to Metro style apps to be called from a Metro style app. COM objects which are available to Metro style apps (either because they are on the approved list of system COM objects or because they are included in your package via registration free COM) are called the same way those objects would be called from any application.

    --Rob

    Monday, July 16, 2012 5:12 PM
    Owner
  • Hi, Rob.

    Can I include a System COM object(in the approved list) in my package via registraion free COM?

    To this way,

    Can I use the WebBrowser control in metro style app with included "ieframe.dll" in my package via registration free COM?

    Thursday, September 05, 2013 7:17 AM