Rich Error Information
Most COM programmers know that COM objects return a data structure called an HRESULT to indicate the status of a method call. If the method is successful, the COM object should return S_OK. If the method fails, the COM object can return any number of pre-defined HRESULTS, such as E_FAIL or E_INVALIDARG, or you can use the MAKE_HRESULT macro to create your own error HRESULTs. Although just returning an HRESULT is sufficient in some cases, in many cases, a client will want a textual description of the error, the name of the method that was the source of the error, and perhaps even a link to a help file that contains additional information about the error. A COM object can return this sort of rich error information to a client ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access