O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

COM

The situation didn’t get much better in the Component Object Model. Again, integral values are used to report errors, now hidden behind a typedef called HRESULT (which originally stood for handle to a result). One thing we should grant COM is adding a tiny little bit more structure to error handling by introducing style guidelines on the way functions should report errors. In Win32, each function had its own habits, some of which returned an error code as a return value, whereas others relied on GetLastError facilities. But guidelines are just that: guidelines. Occasionally, you will find COM APIs that don’t follow those guidelines.

Because the typical COM API design is to have functions return an HRESULT, resulting checking macros such as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required