~dliroulet/ocsinventory-windows-agent/trunk

« back to all changes in this revision

Viewing changes to OcsSystray/OcsSystray.cpp

  • Committer: Didier Liroulet
  • Date: 2014-08-22 13:24:01 UTC
  • Revision ID: didier.liroulet@ocsinventory-ng.org-20140822132401-am5b1o70xfu5opds
Fix Bug #1329003: custom warnings are empty,  and Bug #1343818: show empty inventory information. COM initialization is no more needed into OcsSystray and OcsNotifyUser projects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
        // of your final executable, you should remove from the following
60
60
        // the specific initialization routines you do not need
61
61
 
62
 
        // Initialize COM.
63
 
        if (FAILED( CoInitializeEx( 0, COINIT_MULTITHREADED)))
64
 
        {
65
 
                AfxMessageBox( _T( "Failed to initialize COM"));
66
 
                return FALSE; // terminates the application
67
 
        }
68
 
        // Set general COM security levels --------------------------
69
 
        if (FAILED( CoInitializeSecurity(       NULL, 
70
 
                                                                        -1,                          // COM authentication
71
 
                                                                        NULL,                        // Authentication services
72
 
                                                                        NULL,                        // Reserved
73
 
                                                                        RPC_C_AUTHN_LEVEL_DEFAULT,   // Default authentication 
74
 
                                                                        RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation  
75
 
                                                                        NULL,                        // Authentication info
76
 
                                                                        EOAC_NONE,                   // Additional capabilities 
77
 
                                                                        NULL                         // Reserved
78
 
                                                                        )))
79
 
        {
80
 
                AfxMessageBox( _T( "Failed to initialize COM Security"));
81
 
                CoUninitialize();
82
 
                return FALSE; // terminates the application
83
 
        }
84
 
 
85
62
        // Start systray icon
86
63
        COcsSystrayDlg dlg;
87
64
        m_pMainWnd = &dlg;
100
77
 
101
78
int COcsSystrayApp::ExitInstance() 
102
79
{
103
 
        // Free COM
104
 
        CoUninitialize();
105
80
        return CWinApp::ExitInstance();
106
81
}