Bridges between Win runtime APIs and managed desktop apps

How to use WinRT APIs from managed desktop apps: Managed desktop apps and Windows Runtime – Windows app development. This way is simple. Some available API are packaged in facade assemblies that can be consumed from desktop apps as reference. COM sharing is also detailed.

How to use desktop hosted server from Windows store apps: Brokered Windows Runtime Components for side-loaded Windows Store apps. This way is more restrictive. First, only side-loaded windows store apps can benefits from this mechanism. Then, server must be hosted in special .Net 4.5 assemblies, and last, contracts must be written as winRT components with several limitations:

  • 64 bits restrictions,
  • obligation of providing interface only used by internal mechanism,
  • too much manual winmd file generation,
  • lost of “this field must have such value if you want to avoid strange error message or undefined behavior”,
  • exchanged method parameters must favor bulk transfert using Array of struct (marshalled once) instead of using List<class> where each Next and each property get is a cross-process transfert involving marshalling.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s