Changeset 101


Ignore:
Timestamp:
Aug 23, 2012, 11:20:02 AM (12 years ago)
Author:
roman
Message:
 
Location:
trunk/Utilities/ShowHresult
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/ShowHresult/NotifyIconWindow.h

    r100 r101  
    1717#include <wincodec.h> // FACILITY_WINCODEC_ERR
    1818#include <wia_lh.h> // FACILITY_WIA
     19#include <corerror.h> // FACILITY_URT
    1920#include "rowinhttp.h"
    2021#include "AboutDialog.h"
     
    273274                return _T("");
    274275        }
     276        static BOOL IsUrtResult(HRESULT nResult, CString* psMessage = NULL)
     277        {
     278                if(HRESULT_FACILITY(nResult) != FACILITY_URT)
     279                        return FALSE;
     280                psMessage;
     281                return !LookupUrtIdentifier(nResult).IsEmpty();
     282        }
     283        static CString LookupUrtIdentifier(HRESULT nValue)
     284        {
     285                static const struct { HRESULT nValue; LPCSTR pszName; } g_pMap[] =
     286                {
     287                        #define A(x) { x, #x },
     288                        #include "UrtIdentifier.inc"
     289                        #undef A
     290                };
     291                for(SIZE_T nIndex = 0; nIndex < DIM(g_pMap); nIndex++)
     292                        if(g_pMap[nIndex].nValue == nValue)
     293                                return CString(g_pMap[nIndex].pszName);
     294                return _T("");
     295        }
    275296
    276297public:
     
    384405                        sTitle = _T("WIA");
    385406                        sIdentifier = LookupWiaIdentifier(nResult);
     407                } else if(IsUrtResult(nResult, &sMessage))
     408                {
     409                        sTitle = _T(".NET");
     410                        sIdentifier = LookupUrtIdentifier(nResult);
    386411                } else
    387412                {
  • trunk/Utilities/ShowHresult/ShowHresult.vcxproj

    r100 r101  
    299299    <ClInclude Include="stdafx.h" />
    300300    <ClInclude Include="targetver.h" />
     301    <None Include="UrtIdentifier.Inc" />
    301302    <None Include="WiaIdentifier.inc" />
    302303    <None Include="WicIdentifier.inc">
  • trunk/Utilities/ShowHresult/ShowHresult.vcxproj.filters

    r100 r101  
    8787      <Filter>Header Files\Include Files</Filter>
    8888    </None>
     89    <None Include="UrtIdentifier.Inc">
     90      <Filter>Header Files\Include Files</Filter>
     91    </None>
    8992  </ItemGroup>
    9093  <ItemGroup>
  • trunk/Utilities/ShowHresult/ShowHresult_i.c

    r100 r101  
    77
    88 /* File created by MIDL compiler version 7.00.0555 */
    9 /* at Thu Aug 23 01:55:17 2012
     9/* at Thu Aug 23 21:13:02 2012
    1010 */
    1111/* Compiler settings for ShowHresult.idl:
  • trunk/Utilities/ShowHresult/ShowHresult_i.h

    r100 r101  
    55
    66 /* File created by MIDL compiler version 7.00.0555 */
    7 /* at Thu Aug 23 01:55:17 2012
     7/* at Thu Aug 23 21:13:02 2012
    88 */
    99/* Compiler settings for ShowHresult.idl:
Note: See TracChangeset for help on using the changeset viewer.