Hello
Yesterday I tried to add system tray icon to my C++ (MFC, MS Visual Studio 7.1.3088) application. NI::CNiSystemTrayIcon class provides this, so I thought it will be easy. Well, maybe it is, but not for me :-). I found out that even adding the following line:
NI::CNiSystemTrayIcon system_tray_icon;
to my CWnd - derived main window class (sidenote: I'm using MFC but not Document/View, MDI or other MS inventions, just plain MFC CWnd and my own derived classes) causes assertion failure on application startup. Please note that I don't call any methods on this class (except constructor, which of course gets called automatically) and yet it causes assertion failure!
I also tried to create NI::CNiSystemTrayIcon dynamically, using operator new, when my main window gets created (just after Create returns).
That causes assertion failure, too, when application is run in debug mode (traced). No assertion failure occurs if I just run executable file (debug version, but run independently), thought.
My question is: how to use CNiSystemTray icon properly? What I'm doing wrong?
Best regards
Michal