, evildictait​or wrote

It's not the fault of HRESULTs that they are crappy. It's the fault of developers for daring to attempt writing code in anything other than the glorious language of C/C++. If all developers could agree to only ever use C++, I'm sure Microsoft would be happy to dump HRESULTs and move to std::exceptions Smiley

Actually, HRESULTs are a COM thing, not Win32. And COM has very strong roots in Visual Basic, not C/C++.

Also, Win32 itself was designed for C, and was created before C++ finished the standardization process, so C++ exceptions were never an option. C++ exceptions are also relatively expensive, and most high-performance C++ code bases do not use them.