locked
WinRT and C# apps RRS feed

  • Question

  • I guess it has too late to ask this question. WinRT as I understand is a native API. I also understand that .Net Framework 4.5 can be used to write Windows Store apps. My question is since WinRT is native ,where does .Net Framework 4.5 comes into the picture? When I am calling WinRT APIs in a C# Windows Store app, am I calling native APIs actually?
    Thursday, July 11, 2013 8:45 AM

Answers

  • Your C# code will run in managed .Net. When you call Windows Runtime API it will interop with native Windows Runtime code. You can watch the transition if you run your app in the mixed mode debugger and turn off "Just my code".

    This is the same as if when you call a Win32 API or control from a WinForms app.

    --Rob

    Thursday, July 11, 2013 1:54 PM
    Moderator

All replies

  • hi,

    Yes,I think you could calling WinRT APIs just like calling native APIs.WinRT runs in a sandboxed mode,and it provides easy access to the features of another application (check the charms for example),and it will help you do more things than Win32.Maybe,you'll like it after you have more knowlage on it.

    Thursday, July 11, 2013 10:44 AM
  • Thanks for the reply. But my question is when u r calling WinRT APIs in C# Windows store app, are we actually calling the native APIs? Where does .Net 4.5 fit in the picture? Isnt it managed?
    Thursday, July 11, 2013 11:15 AM
  • This article on wiki gives nice introduction about WinRT framework and also answers your first question. Also .Net 4.5 and .Net used for windows store app are little different. .Net called as .Net for Store App is small subset of complete .Net framework which is used in store apps. 

    Windows API reference for Windows Store apps



    Thanks,
    Sachin
    My Samples

    Thursday, July 11, 2013 1:44 PM
  • Your C# code will run in managed .Net. When you call Windows Runtime API it will interop with native Windows Runtime code. You can watch the transition if you run your app in the mixed mode debugger and turn off "Just my code".

    This is the same as if when you call a Win32 API or control from a WinForms app.

    --Rob

    Thursday, July 11, 2013 1:54 PM
    Moderator
  • Thank you all for your replies. That was well explained..

    Friday, July 12, 2013 4:24 AM
  • Congratulations on your understanding. You are now among 0.00001% of people who really know this system.

    shenzy

    Friday, July 12, 2013 5:20 AM