CComGITPtr::Attach

调用此方法注册接口指针在全局接口表(GIT)中。

HRESULT Attach( 
   T* p  
) throw( ); 
HRESULT Attach( 
   DWORD dwCookie  
) throw( );

参数

  • p
    要添加的接口指针。GIT。

  • dwCookie
    用cookie标识接口指针。

返回值

返回在成功的S_OK或在失败时错误HRESULT。

备注

在调试版本中,断言将发生错误,则GIT无效,或者,如果cookie与NULL相等。

要求

Header: atlbase.h

请参见

参考

CComGITPtr Class

CComGITPtr::Detach