Commit a4dda4d5 authored by Didier Liroulet's avatar Didier Liroulet
Browse files

Fix string formatting bug while displaying message to user

parent d14f0f6a
......@@ -234,14 +234,14 @@ void COcsSystrayDlg::OnShowInventory()
csXml.Format( _T( "%s\\OCSInventory.xml"), getDataFolder());
if (!fileExists( csXml))
{
csXml.FormatMessage( IDS_SHOW_INVENTORY_FAILED, _T( "Service did not generate XML file"));
csXml.Format( IDS_SHOW_INVENTORY_FAILED, _T( "Service did not generate XML file"));
AfxMessageBox( csXml, MB_OK|MB_ICONEXCLAMATION);
return;
}
cDlg.SetInventory( csXml);
if (cDlg.DoModal() != IDCANCEL)
{
csXml.FormatMessage( IDS_SHOW_INVENTORY_FAILED, _T( "Unknown"));
csXml.Format( IDS_SHOW_INVENTORY_FAILED, _T( "Unknown"));
AfxMessageBox( csXml, MB_OK|MB_ICONEXCLAMATION);
return;
}
......
......@@ -61,8 +61,16 @@ BOOL CShowInventoryDlg::OnInitDialog()
// Set link to OCS Web site
m_HLink.SetLinkUrl( _T( "http://www.ocsinventory-ng.org"));
// Display XML using SimpleBrowser
m_Browser.CreateFromControl( this, IDC_BROWSER);
m_Browser.Navigate( m_csXml);
if (!m_Browser.CreateFromControl( this, IDC_BROWSER))
{
CString csMessage;
csMessage.Format( IDS_SHOW_INVENTORY_FAILED, _T( "Failed to create MSIE Control for displaying inventory"));
AfxMessageBox( csMessage, MB_OK|MB_ICONEXCLAMATION);
}
else
m_Browser.Navigate( m_csXml);
return TRUE; // return TRUE unless you set the focus to a control
}
......
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