Authored by Philipp

Windows toast notification test

This was first a little app to verify that calling C++ from GLib C code works.

I extended it following the Windows Dev Center article up to step 3, the inclusion of the header files and namespaces. This is where Visual Studio reports errors in the headers.

gwin32notificationbackendprivate.h contains only:


void set_and_print_number(int number);

  • DesktopNotificationManagerCompat.{cpp,h} have been downloaded as gwin32notificationbackendcompat.{cpp,h}
  • Adding #include "stdafx.h" resulted in an error that this file couldn't be found, so I left it out
  • All files are in the same folder as the project files.
gwin32notificationbackendprivate.cpp 822 Bytes
  • You never did this from the guide:

    #include "DesktopNotificationManagerCompat.h"
  • It's that one because I downloaded it under that name as mentioned in the description:

    #include "gwin32notificationbackendprivate.h"
    Edited by Philipp
  • but you said gwin32notificationbackendcompat.h contains only a single function declaration. MS don't want you to include that: they want you to include the contents of DesktopNotificationManagerCompat.h as they provided. If you don't, it's probably not surprising that you get errors about undefined things, which their article probably expects you will have had defined by what they told you to include.

    To be clear: I am suggesting to include DesktopNotificationManagerCompat.h in whatever 3rd source file you are implementing following the remaining steps (not e.g. assume that only its correspondingly named .cpp needs to include it)

    Edited by Daniel Boles
  • I used the wrong file name in the description, it was meant to say gwin32notificationbackendprivate.h. I corrected the description and my comment.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment