After modifying the inheritance of RMyProviderRowset, you need to implement the IRowsetLocate
interface. You can find the interface definition in the Interface Summary of the OLE DB Programmer's Reference and in the OLEDB.H file in the OLE DB SDK include directory.
To implement this interface:
IRowsetLocateImpl
, derived from IRowset, and implement the class.////////////////////////////////////////////////////////////////////////
// RowLoc.h
// class IRowsetLocateImpl
template <class T>
class ATL_NO_VTABLE IRowsetLocateImpl : public IRowsetImpl<T>
{
public:
STDMETHOD (Compare)(HCHAPTER hReserved, ULONG cbBookmark1,
const BYTE * pBookmark1, ULONG cbBookmark2, const BYTE *
pBookmark2, DBCOMPARE * pComparison)
{
return S_OK;
}
STDMETHOD (GetRowsAt)(HWATCHREGION hReserved1, HCHAPTER hReserved2,
ULONG cbBookmark, const BYTE * pBookmark, LONG lRowsOffset,
LONG cRows, ULONG * pcRowsObtained, HROW ** prghRows)
{
return S_OK;
}
STDMETHOD (GetRowsByBookmark)(HCHAPTER hReserved, ULONG cRows,
const ULONG rgcbBookmarks[], const BYTE * rgpBookmarks[],
HROW rghRows[], DBROWSTATUS rgRowStatus[])
{
return S_OK;
}
STDMETHOD (Hash)(HCHAPTER hReserved, ULONG cBookmarks,
const ULONG rgcbBookmarks[], const BYTE * rgpBookmarks[],
DWORD rgHashedValues[], DBROWSTATUS rgBookmarkStatus[])
{
ATLTRACENOTIMPL("IRowsetLocateImpl::GetRowsByBookmark");
}
};
In the next topic, you will see how to complete the implementation by adding bookmarks.