Hresult Return Value

Source: Internet
Author: User

The following table lists the values of common hresult values. More values are contained in the header file winerror. h.

Name Description Value
S_ OK Operation successful Zero X 00000000
E_unexpected Unexpected failure 0x8000ffff
E_notimpl Not Implemented Zero X 80004001
E_outofmemory Failed to allocate necessary memory 0x8007000e
E_invalidarg One or more arguments are invalid Zero X 80070057
E_nointerface No such interface supported Zero X 80004002
E_pointer Invalid Pointer Zero X 80004003
E_handle Invalid handle Zero X 80070006
E_abort Operation aborted Zero X 80004004
E_fail Unspecified failure Zero X 80004005
E_accessdenied General Access Denied Error Zero X 80070005
S_false Operation Failure  

 

Hresult is actually a dubyte value. If the highest bit (BIT) is 0, the result is successful, and 1 indicates an error. If we need to determine the return value in the program, we can use the comparison operator number, switch statement, or the macro provided by VC:

Hresult hR = call component functions; If (succeeded (HR )){...} // if it succeeds ...... if (failed (HR )){...} // if it fails

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.