How I can make a platform agnostic C++ WinRT Component?
-
8. března 2012 19:44
If i want to create a C++ WinRT component. You have three platform which are x86/x64/ARM and each platform generates different dlls and winmd files (winmd differences are very minimal).
Now i have an AnyCPU C# project and i want to reference that C++ WinRT components. How do i do that?
For P/Invoke, you can use LoadLibrary trick to load right platform native dll. But Metro application references winmd file instead of write P/Invoke definitions. So, i'm wondering that how i can make platform agnostic C++ WinRT component.
Všechny reakce
-
8. března 2012 20:46
The moment you use a C++ component from your C# component, you then need to create as many versions as you intend to target (ARM/X86/X64).- Označen jako odpověď DavidLambMicrosoft Employee, Moderator 13. března 2012 15:47
-
9. března 2012 9:27
Thanks for reply Nishant,
That what VS11 Beta does now. But if you take a look at the Windows Kits directory, it only has one winmd file that you can reference from AnyCPU assembly and you don't need to create multiple version of assemblies.
I'd like to know how i can do same thing.
-
13. března 2012 15:47Moderátor
As Nishant mentioned, once you reference a C++ component from your C# app, you will need to generate separate platform specific packages to upload to the store instead of a Neutral package. There is a related thread you may want to review as well.
David Lamb