I've been experimenting with Windows Imaging Component (WIC) in C++ and while everything works I'd like to be able to display descriptive error messages when WIC fails to load or transform an image.
MSDN documents the various error codes but no way of getting the error message. The solution is probably a combination of LoadLibrary(...) to get the hModule followed by FormatMessage(FORMAT_MESSAGE_FROM_HMODULE, ...). I haven't found the correct DLL to load yet.
Any help is much appreciated.
Try
FormatMessage
withFORMAT_MESSAGE_FROM_SYSTEM
. A number of errors were added for Windows 8.x, so it likely returns more useful results on that platform.See this blog post for an updated version of the venerable DXERR.LIB which includes WIC errors.