GME  13
CommonMfc.cpp
Go to the documentation of this file.
00001 
00002 #include "stdafx.h"
00003 #include "CommonMfc.h"
00004 #include <stdio.h>
00005 
00006 // --------------------------- Error
00007 
00008 void DisplayError(const TCHAR *msg, HRESULT hr)
00009 {
00010         ASSERT( msg != NULL );
00011 
00012         CString a;
00013         a.Format(_T(" (0x%x)"), hr);
00014         a.Insert(0, msg);
00015 
00016         CString desc;
00017         GetErrorInfo(hr, PutOut(desc));
00018 
00019         if( !desc.IsEmpty() )
00020         {
00021                 a += _T(": ");
00022                 a += desc;
00023         }
00024 
00025         AfxMessageBox(a, MB_OK | MB_ICONSTOP);
00026 }
00027