0

How do I interpret HRESULT -2003292276?

This is returned by calling IWICFactory factory->CreateBitmapFromMemory():

hr = m_factory->CreateBitmapFromMemory(
  m_format.imageWidthPels, 
  m_format.imageHeightPels, 
  GUID_WICPixelFormat32bppBGR, 
  m_format.strideSize,
  cbBitmapData,
  data,
  &pBitmap);
the Tin Man
  • 158,662
  • 42
  • 215
  • 303

3 Answers3

2

From Wikipedia:

The winerror.h file defines some generic HRESULT values. Hard-coded HRESULT values are sometimes encoded in associated header files (.h files) for a given subsystem. These values are also defined in the corresponding header (.h) files with the Microsoft Windows Platforms SDK or DDK.

To check if a call that returns an HRESULT succeeded, make sure the S field is 0 (i.e. the number is non-negative) or use the FAILED() macro. To obtain the Code part of an HRESULT, use the HRESULT_CODE() macro. You can also use a tool called ERR.EXE to take the value and translate it to the corresponding error string. Another tool called ERRLOOK.EXE can also be used to display error strings associated with a given HRESULT value. ERRLOOK.EXE can be run from within a Visual Studio command prompt.

The Windows native SetErrorInfo and GetErrorInfo APIs are used to associate HRESULT return codes with a corresponding IErrorInfo object.

The FormatMessage API function can be used to convert some non-IErrorInfo HRESULTs into a user-readable string.

Community
  • 1
  • 1
Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
1

Codec Error Codes

This document contains a list of the Windows Imaging Component (WIC) defined error codes.

| Error Code                      | Error Value |
|---------------------------------|-------------|
| WINCODEC_ERR_INSUFFICIENTBUFFER | 0x88982f8C  |

You're creating an image that is too big.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
1

It can be tricky to search for HRESULTs on the web since you often have to convert the large negative number to hex and search for that (presumably that is what Ian did in his correct answer). There are also command-line tools like ERRLOOK.exe that Ted describes (which is one of the better command-line options) that will convert the numbers to defines or error descriptions.

But we found a web browser is sometimes handier than a cmd prompt so we created http://errorco.de that contains many, many error messages you can search for by whatever number you have at hand.

For example, taking your -2003292276 to http://errorco.de will give you:

This errorco.de is a pseudonym for winerror.h 0x88982F8C.
See that errorco.de for possible comments or remarks.

winerror.h -2003292276
#define WINCODEC_ERR_INSUFFICIENTBUFFER
The buffer allocated is insufficient.

All the information mentioned by Ian and Ted on one page (and easy to share with others if necessary). Maybe you'll find it useful.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130