Commit 557705c2 authored by Didier Liroulet's avatar Didier Liroulet
Browse files

Fix Bug #1329003: custom warnings are empty, and Bug #1343818: show empty...

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.
parent fb138ac1
......@@ -68,28 +68,6 @@ BOOL COcsNotifyUserApp::InitInstance()
if (!CWinApp::InitInstance())
return FALSE; // terminates the application
// Initialize COM.
if (FAILED( CoInitializeEx( 0, COINIT_MULTITHREADED)))
{
AfxMessageBox( _T( "Failed to initialize COM"));
return FALSE; // terminates the application
}
// Set general COM security levels --------------------------
if (FAILED( CoInitializeSecurity( NULL,
-1, // COM authentication
NULL, // Authentication services
NULL, // Reserved
RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication
RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation
NULL, // Authentication info
EOAC_NONE, // Additional capabilities
NULL // Reserved
)))
{
AfxMessageBox( _T( "Failed to initialize COM Security"));
CoUninitialize();
return FALSE; // terminates the application
}
// Logger
CTime cStartTime; // Start time of the inventory check
cStartTime = CTime::GetCurrentTime();
......@@ -193,8 +171,6 @@ BOOL COcsNotifyUserApp::InitInstance()
int COcsNotifyUserApp::ExitInstance()
{
m_pLogger->log( LOG_PRIORITY_DEBUG, _T( "Notification Tool => Exit code is %d"), m_nExitCode);
// Free COM
CoUninitialize();
CWinApp::ExitInstance();
return m_nExitCode;
}
......
......@@ -59,29 +59,6 @@ BOOL COcsSystrayApp::InitInstance()
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Initialize COM.
if (FAILED( CoInitializeEx( 0, COINIT_MULTITHREADED)))
{
AfxMessageBox( _T( "Failed to initialize COM"));
return FALSE; // terminates the application
}
// Set general COM security levels --------------------------
if (FAILED( CoInitializeSecurity( NULL,
-1, // COM authentication
NULL, // Authentication services
NULL, // Reserved
RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication
RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation
NULL, // Authentication info
EOAC_NONE, // Additional capabilities
NULL // Reserved
)))
{
AfxMessageBox( _T( "Failed to initialize COM Security"));
CoUninitialize();
return FALSE; // terminates the application
}
// Start systray icon
COcsSystrayDlg dlg;
m_pMainWnd = &dlg;
......@@ -100,7 +77,5 @@ BOOL COcsSystrayApp::InitInstance()
int COcsSystrayApp::ExitInstance()
{
// Free COM
CoUninitialize();
return CWinApp::ExitInstance();
}
Supports Markdown
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