Changeset 100 for trunk/Utilities/ShowHresult/NotifyIconWindow.h
- Timestamp:
- Aug 22, 2012, 4:05:02 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/ShowHresult/NotifyIconWindow.h
r99 r100 16 16 #include <d2derr.h> // FACILITY_D2D 17 17 #include <wincodec.h> // FACILITY_WINCODEC_ERR 18 #include <wia_lh.h> // FACILITY_WIA 18 19 #include "rowinhttp.h" 19 20 #include "AboutDialog.h" … … 252 253 return _T(""); 253 254 } 255 static BOOL IsWiaResult(HRESULT nResult, CString* psMessage = NULL) 256 { 257 if(HRESULT_FACILITY(nResult) != FACILITY_WIA) 258 return FALSE; 259 psMessage; 260 return !LookupWiaIdentifier(nResult).IsEmpty(); 261 } 262 static CString LookupWiaIdentifier(HRESULT nValue) 263 { 264 static const struct { HRESULT nValue; LPCSTR pszName; } g_pMap[] = 265 { 266 #define A(x) { x, #x }, 267 #include "WiaIdentifier.inc" 268 #undef A 269 }; 270 for(SIZE_T nIndex = 0; nIndex < DIM(g_pMap); nIndex++) 271 if(g_pMap[nIndex].nValue == nValue) 272 return CString(g_pMap[nIndex].pszName); 273 return _T(""); 274 } 254 275 255 276 public: … … 359 380 sTitle = _T("WinCodec"); 360 381 sIdentifier = LookupWicIdentifier(nResult); 382 } else if(IsWiaResult(nResult, &sMessage)) 383 { 384 sTitle = _T("WIA"); 385 sIdentifier = LookupWiaIdentifier(nResult); 361 386 } else 362 387 {
Note: See TracChangeset
for help on using the changeset viewer.