开发者

How does the mapping between WinRT and managed works?

开发者 https://www.devze.com 2023-04-05 20:33 出处:网络
I heard that the new WinRT is an unmanaged framework and it is based on COM, but someho开发者_运维技巧w they figured out something to make mapping between WinRT and managed code easier. I would like t

I heard that the new WinRT is an unmanaged framework and it is based on COM, but someho开发者_运维技巧w they figured out something to make mapping between WinRT and managed code easier. I would like to know how this mechanism works?


The Windows Runtime represents all APIs in metadata, which the various language projections (C++, JavaScript and C#) read.

Because the API shape is described in metadata, the language runtimes and compilers can reason about the APIs and know how to generate code for those APIs.

For the CLR, the job is a tiny bit easier, since the metadata format is ECMA 335, which is the CLI metadata format used by the CLR - thus the translation is slightly easier for the CLR.

But in general, the translation is straightforward given that you have a machine readable representation of all the APIs present on the machine.

0

精彩评论

暂无评论...
验证码 换一张
取 消