Search code examples
c#c++windows-runtimewindows-8.1winrt-component

Is It Possible to Use IGetActivationFactory.GetActivationFactory in C#?


I am learning WinRT and have found this interface: https://msdn.microsoft.com/en-us/library/windows.foundation.igetactivationfactory.aspx

However, all of the samples that I have seen (example here) are in C++. Is it possible to access this method and invoke its GetActivationFactory from C#?

And if so, how?


Solution

  • Hope this reply is not too late.

    The IGetActivationFactory should be only used in the scenario mentioned in the frist link in your post:

    The scenario that IGetActivationFactory supports is if you are defining Windows Runtime components using WRL, which are packaged as separate executables.

    So that means when you are developing out-of-process component like this sample, call it to do manual activiation.

    And we should let the component itself to handle the activation in this case. So don't try to call it from your C# code.