SUMMARY The Notification does not show, also, there is no debug output. I'm sorry for the vague report, it's all I have at this point. STEPS TO REPRODUCE 1. Download SnoreToast nightly (commit 4240c64dc51ea71b00a603c96f84e9cd0c53874b) 2. Run the Installer 3. Run `SnoreToast.exe -t Hello -m World` Alternatively: 1. Download sources (commit 4240c64dc51ea71b00a603c96f84e9cd0c53874b) 2. Compile with MSVC 19.21.27702.2 (cmake, nmake) 3. Run `SnoreToast.exe -t Hello -m World` OBSERVED RESULT No Notification is shown. While the nightly version reports a return code of 0, the locally compiled version reports an error code of 5. Also, no log output in DebugView++. EXPECTED RESULT Notification is shown. Optionally, log output in DebugView++. SOFTWARE/OS VERSIONS Windows: Version 10.0.17763 Build 17763 ADDITIONAL INFORMATION An older (beginning of June 2019) locally compiled version gave this log output: ``` "Y:\\Notifications\\SnoreToast.exe" v 0.5.99 long __cdecl LinkHelper::tryCreateShortcut(const class std::filesystem::path &,const class std::filesystem::path &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &) Path: "C:\\Users\\dee\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\SnoreToast\\0.5.99\\SnoreToast.lnk" already exists, skip creation of shortcut "Y:\\Notifications\\SnoreToast.exe" v 0.5.99 void __cdecl SnoreToasts::printXML(void) ------------------------ <toast launch="action=clicked;notificationId=1828;version=0.5.99;"><visual><binding template="ToastText02"><text id="1">Hello</text><text id="2">World</text></binding></visual><audio src="ms-winsoundevent:Notification.Default" silent="false"/></toast> ------------------------ "Y:\\Notifications\\SnoreToast.exe" v 0.5.99 long __cdecl SnoreToasts::createToast(void) Error: -2147023728 Element not found. Error: -2147023728 Element not found. "Y:\\Notifications\\SnoreToast.exe" v 0.5.99 long __cdecl SnoreToasts::createToast(void) Error: -2147023728 Element not found. Error: -2147023728 Element not found. "Y:\\Notifications\\SnoreToast.exe" v 0.5.99 long __cdecl SnoreToasts::displayToast(const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,const class std::filesystem::path &) Error: -2147023728 Element not found. Error: -2147023728 Element not found. ``` Also, I just realized that nothing ever happens, no matter what parameters I give, I have the feeling they are being completely ignored. I'll open a seperate issue for that.
Hm thx for the report. That debugview++ doesn't show anything makes me doubt that the correct SnoreToast.exe is executed. where.exe SnoreToast.exe returns the correct path? If the correct version is used, could you remove the all SnoreToast shortcuts from your start menu and try again?
``` C:\Program Files\SnoreToast\bin>where SnoreToast.exe C:\Program Files\SnoreToast\bin\SnoreToast.exe ``` Waiting until bug #409124 is resolved before further investigation.
Ok. Bug #409124 is resolved, let's go! For some reason it did not work the first time, but worked the second time I executed `SnoreToast.exe -t Hello -m World`, here is the log: First: ``` "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 long __cdecl LinkHelper::installShortcut(const class std::filesystem::path &,const class std::filesystem::path &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &) Installing shortcut: "C:\\Users\\dee\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\SnoreToast\\0.5.99\\SnoreToast.lnk" "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" Snore.DesktopToasts.0.5.99 {383803B6-AFDA-4220-BFC3-0DBF810106BF} "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 long __cdecl LinkHelper::installShortcut(const class std::filesystem::path &,const class std::filesystem::path &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &) SOFTWARE\Classes\CLSID\{383803B6-AFDA-4220-BFC3-0DBF810106BF}\LocalServer32 "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 long __cdecl LinkHelper::installShortcut(const class std::filesystem::path &,const class std::filesystem::path &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &) 943195062 "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 void __cdecl SnoreToasts::printXML(void) ------------------------ <toast launch="action=clicked;notificationId=5968;version=0.5.99;"><visual><binding template="ToastText02"><text id="1">Hello</text><text id="2">World</text></binding></visual><audio src="ms-winsoundevent:Notification.Default" silent="false"/></toast> ------------------------ "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 bool __cdecl Utils::checkResult(const char *,const long,const char *,const long &) C:\_\3878ba29\snoretoast\src\snoretoasts.cpp long __cdecl SnoreToasts::createToast(void) : Error: -2147023728 Element not found. "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 long __cdecl SnoreToasts::createToast(void) Failed to retreive NotificationSettings ensure your appId is registered ``` Second: ``` "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 long __cdecl LinkHelper::tryCreateShortcut(const class std::filesystem::path &,const class std::filesystem::path &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &) Path: "C:\\Users\\dee\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\SnoreToast\\0.5.99\\SnoreToast.lnk" already exists, skip creation of shortcut "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 void __cdecl SnoreToasts::printXML(void) ------------------------ <toast launch="action=clicked;notificationId=1308;version=0.5.99;"><visual><binding template="ToastText02"><text id="1">Hello</text><text id="2">World</text></binding></visual><audio src="ms-winsoundevent:Notification.Default" silent="false"/></toast> ------------------------ "C:\\Program Files\\SnoreToast\\bin\\SnoreToast.exe" v 0.5.99 long __cdecl ToastEventHandler::Invoke(struct ABI::Windows::UI::Notifications::IToastNotification *,struct ABI::Windows::UI::Notifications::IToastDismissedEventArgs *) The toast has timed out ```
In the first run it detected that there is no shortcut with an app id is installed, so it creates one. As there was no valid app id when the application was lunched windows prevents the display of the notification. In the second run everything works fine as the shortcut and app id are known. If you plan to use snoretoast with your own project, I'd recommend to install a shortct first, see the nsis script as an example, and pass the app id to snoretoast.
Ok, I already though that this was the issue. I just expected the shortcut to be created before the notification was issued, but of course it makes sense to only run the shortcut logic when the notification fails. Will definitely use our own app id, thank you for the NSIS example.
The shortcut is created before, but I guess there is some magic on the Windows side happening. Maybe a wait would help but as the internal id is mainly for dev purpose or simple shell scripts a missed notification is not a big deal.