question

Paul-5895 avatar image
0 Votes"
Paul-5895 asked NicoZhu-MSFT edited

windows.ui.notifications.h vs winrt/windows.ui.notifications.h | What should i use?

I have a short question about Windows 10 development with cpp:

When should i use <windows.ui.notifications.h> and when <winrt/Windows.UI.Notifications.h>, and why are there two versions of this header.

I found out that windows.ui.notifications.h is in windowssdk.......\include\winrt and <winrt/Windows.UI.Notifications.h> is in windowssdk....\include\cppwinrt.
And windows.ui.notifications.h contains also namespaces like ABI::Windows::Data::Xml::Dom; whereas <winrt/Windows.UI.Notifications.h> does not contains these namespaces but the winrt namespace. So what should i use for what??? why are there the same headers but with such differences?
-- but i thought that for example, Windows::Data::Xml::Dom should be in Windows.Data.Xml.Dom.h and not accessible via the notifications header.

Can someone please help?

windows-uwpwindows-apic++
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What type of UWP you have made? C++ CX or C++/Wrt ?

0 Votes 0 ·

1 Answer

NicoZhu-MSFT avatar image
1 Vote"
NicoZhu-MSFT answered NicoZhu-MSFT edited

Hello, Welcome to Micorosoft Q&A,

windows.ui.notifications.h vs winrt/windows.ui.notifications.h | What should i use?

It is based on which namespace is selected for your uwp language. If you was using C++CX, please include windows.ui.notifications.h, And if you are using C++WinRT, please include winrt/windows.ui.notifications.h. Or it will throw head file not found exception.


And windows.ui.notifications.h contains also namespaces like ABI::Windows::Data::Xml::Dom;


A Windows Runtime class (runtime class) is really an abstraction. This abstraction defines a binary interface (the Application Binary Interface, or ABI) that allows various programming languages to interact with an object. Regardless of programming language, client code interaction with a Windows Runtime object happens at the lowest level, with client language constructs translated into calls into the object's ABI.

For more please refer this document.



If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.