หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Microsoft Specific
Encapsulates a raw interface pointer of this smart pointer's type.
Syntax
void Attach( Interface* pInterface ) throw( );
void Attach( Interface* pInterface, bool fAddRef ) throw( );
Parameters
pInterface
A raw interface pointer.
fAddRef
If it is true, then AddRef is called. If it is false, the _com_ptr_t object takes ownership of the raw interface pointer without calling AddRef.
Remarks
Attach( pInterface )
AddRefis not called. The ownership of the interface is passed to this_com_ptr_tobject.Releaseis called to decrement the reference count for the previously encapsulated pointer.Attach( pInterface , fAddRef ) If fAddRef is
true,AddRefis called to increment the reference count for the encapsulated interface pointer. If fAddRef isfalse, this_com_ptr_tobject takes ownership of the raw interface pointer without callingAddRef.Releaseis called to decrement the reference count for the previously encapsulated pointer.
END Microsoft Specific