locked
Load C++ plug-ins RRS feed

  • Question

  • Hi,

    I porting a C++ library to be used from Metro, the library that is currently C++ has support for Plug-ins, in Windows Desktop we are using "LoadLibraryW" and "GetProcAddress" to load the plug-ins,  are these methods available for Metro applications? if these aren't available is there an other way to implement plug-ins in shared libraries.

    Regards,

    Jose

    Monday, April 30, 2012 7:10 PM

Answers

  • pepone.onrez wrote:

    Hi,

    I porting a C++ library to be used from Metro, the library that is currently C++ has support for Plug-ins, in Windows Desktop we are using "LoadLibraryW" and "GetProcAddress" to load the plug-ins,  are these methods available for Metro applications? if these aren't available is there an other way to implement plug-ins in shared libraries.

    Regards,

    Jose

    GetProcAddress and LoadLibrary are not available for obvious security reasons.
    Generally speaking, you can only use the dlls that are inside your package.

    In .net for Metro you have a reduced version of MEF. I believe it should not be hard create a Metro component in C# that use MEF and act as a loader for your WinRT C++ (or whatever other language) plugins.
    If that does not work, you can try wrapping your C++ components with a C# layer so that MEF can load them.


    Raffaele Rialdi  http://www.iamraf.net
    Weblog: http://blogs.ugidotnet.org/raffaele
    Microsoft MVP profile https://mvp.support.microsoft.com/profile/raffaele
    UGIdotNET - http://www.ugidotnet.org/


    Raffaele Rialdi [MVP] My articles and videos: http://www.iamraf.net Italian blog: http://blogs.ugidotnet.org/raffaele
    • Marked as answer by pepone.onrez Monday, April 30, 2012 8:22 PM
    Monday, April 30, 2012 7:24 PM