现在的位置: 首页 > 综合 > 正文

HRESULT

2018年04月05日 ⁄ 综合 ⁄ 共 896字 ⁄ 字号 评论关闭

函数返回值。如果这个函数是执行完返回的话将包含就有实际意义的数据,如果立即返回则包含状态信息--发送成功与否,并不能说明执行的如何。

  HRESULT
  A value returned from a function call to an
interface, consisting of a severity code, context information, a
facility code, and a status code that describes the result. For 16-bit
Windows systems, the HRESULT is an opaque result handle defined to be
zero for a successful return from a function, and nonzero if error or
status information is to be returned. To convert an HRESULT into a more
detailed SCODE (or return value), applications call GetSCode(). See
SCODE.
  HRESULT 是一种简单的数据类型,通常被属性和 ATL 用作返回值。下表说明各种不同的值。头文件 winerror.h 中包含更多的值。
  名称 说明 值
  S_OK 操作成功 0x00000000
  E_UNEXPECTED 意外的失败 0x8000FFFF
  E_NOTIMPL 未实现 0x80004001
  E_OUTOFMEMORY 未能分配所需的内存 0x8007000E
  E_INVALIDARG 一个或多个参数无效 0x80070057
  E_NOINTERFACE 不支持此接口 0x80004002
  E_POINTER 无效指针 0x80004003
  E_HANDLE 无效句柄 0x80070006
  E_ABORT 操作已中止 0x80004004
  E_FAIL 未指定的失败 0x80004005
  E_ACCESSDENIED 一般的访问被拒绝错误 0x80070005
  不能简单地把返回值与 S_OK 和 S_FALSE 比较,而要用 SUCCEEDED 和 FAILED 宏进行判断。

抱歉!评论已关闭.