CBookmark Class

Holds a bookmark value in its buffer.

Syntax

template < DBLENGTH nSize = 0 >
class CBookmark : public CBookmarkBase

template <>
class CBookmark< 0 > : public CBookmarkBase

Parameters

nSize
The size of the bookmark buffer in bytes. When nSize is zero, the bookmark buffer will be dynamically created at run time.

Requirements

Header: atldbcli.h

Members

Methods

Name Description
CBookmark The constructor
GetBuffer Retrieves the pointer to the buffer.
GetSize Retrieves the size of the buffer in bytes.
SetBookmark Sets the bookmark value.

Operators

Name Description
operator = Assigns one CBookmark class to another.

Remarks

CBookmark<0> is a template specialization of CBookmark; its buffer is dynamically created at run time.

CBookmark::CBookmark

The constructor.

Syntax

CBookmark();
CBookmark(DBLENGTH nSize);

Parameters

nSize
[in] Size of the bookmark buffer in bytes.

Remarks

The first function sets the buffer to NULL and the buffer size to 0. The second function sets the buffer size to nSize, and the buffer to a byte array of nSize bytes.

Note

This function is only available in CBookmark<0>.

CBookmark::GetBuffer

Retrieves the pointer to the bookmark buffer.

Syntax

virtual BYTE* GetBuffer() const throw();

Return Value

A pointer to the bookmark buffer.

CBookmark::GetSize

Retrieves the size of the bookmark buffer.

Syntax

virtual DBLENGTH GetSize() const throw();

Return Value

The size of the buffer in bytes.

CBookmark::SetBookmark

Copies the bookmark value referenced by pBuffer to the CBookmark buffer and sets the buffer size to nSize.

Syntax

HRESULT SetBookmark(DBLENGTH nSize, BYTE* pBuffer) throw();

Parameters

nSize
[in] The size of the bookmark buffer.

pBuffer
[in] A pointer to the byte array containing the bookmark value.

Return Value

A standard HRESULT.

Remarks

This function is only available in CBookmark<0>.

CBookmark::operator =

Assigns a CBookmark object to another.

Syntax

CBookmark& operator =(const CBookmark& bookmark) throw();

Remarks

This operator is needed only in CBookmark<0>.

See also

OLE DB Consumer Templates
OLE DB Consumer Templates Reference