CTempOLERef

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

The CTempOLERef template class wraps any OLE object. When used to maintain references on OLE objects returned by SQL-DMO, the class ensures that references are released when:

  • An instance of the class is destroyed.

  • An instance of the class is maintaining an existing reference and is assigned a new reference.

Member Functions

CTempOLERef::CTempOLERef

CTempOLERef( ); 

CTempOLERef(OLEPTRpIn);

Creates an instance of the class.

CTempOLERef::p

OLEPTR p( );

Returns an OLEPTR (pointer to an OLE object) from the instance without incrementing the reference count maintained on the OLE object. Returns NULL if the instance is not maintaining a reference.

CTempOLERef::Release

void Release( );

Safely releases a reference maintained by the instance on an OLE object. The function is provided for class completeness. Class destruction and assignment operator implementations ensure reference release, and the use of Release is not required by an application.

Operators

CTempOLERef::operator OLEPTR

operator OLEPTR ( );

Returns the reference maintained by the instance as an OLEPTR. Returns NULL if the instance is not maintaining a reference.

CTempOLERef::operator LPUNKNOWN

operator LPUNKNOWN ( );

Returns the reference maintained by the instance as an LPUNKNOWN. Returns NULL if the instance is not maintaining a reference.

CTempOLERef::operator void*

operator void* ( );

Returns a void pointer to the memory maintaining an OLE object reference.

CTempOLERef::operator BOOL

operator BOOL ( );

Returns TRUE when an instance maintains a reference on a BSTR object. Returns FALSE otherwise.

CTempOLERef::operator =

OLEPTR operator = (OLEPTR

pIn

);

If an OLE object reference is maintained by the instance, the reference is released. The instance maintains the reference on the OLE object assigned to the instance. Returns the reference assigned.

CTempOLERef::operator &

OLEPTR* operator & ();

Returns a pointer to the memory maintaining an OLE object reference as a pointer to an OLEPTR.

CTempOLERef::operator !

BOOL operator ! ();

Returns FALSE when an instance maintains a reference on a BSTR object. Returns TRUE otherwise.

CTempOLERef::operator ->

OLEPTR operator -> ();

Returns the reference maintained by the instance as an OLEPTR. Returns NULL if the instance is not maintaining a reference.

Implements member function dereferencing for the OLE object reference wrapped.