HRESULT hr;
hr = m_pConnection.CreateInstance("ADODB.Connection");///创建Connection对象它是一种句柄吗?是干什么用的?

解决方案 »

  1.   

    就是一个DWORD,用来测试COM对象的函数返回值的。成功返回S_OK,失败返回一个失败代码
      

  2.   

    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
      

  3.   

    一个普通的32bit数,其各个bit都有固定的意义,并且有各种宏来对他进行操作。
      

  4.   

    是一个dword,换位来表示各种意义,一般来说.0(s_ok)代表成功.其它每个位上的值都有不同的意义.