3

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?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Mike-E
  • 2,477
  • 3
  • 22
  • 34

1 Answers1

0

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.

Alan Yao - MSFT
  • 3,284
  • 1
  • 17
  • 16
  • Thank you for your answer, @Alan-Yao. I did see that mention, but it made it sound like it was still possible to access this call from any library, regardless of the language that it is designed in. This seems to be one of the unfortunate qualities and directions of WinRT that I have noticed, in that the original spirit of .NET was that you could have access to any component, regardless of the language used. Now, everything seems to be hidden behind a "Curtain of COM" and it's for C++ developers only. – Mike-E Apr 10 '15 at 11:12