📄 urlfenum.cpp
字号:
// CUrlfEnumItem member functions
#include "stdhdr.h"
#include "urlfenum.h"
/*-------------------------------------------------------------------*/
// Procedure....: CUrlfEnumItem()
// Description..: Constructor of the class
/*-------------------------------------------------------------------*/
CUrlfEnumItem::CUrlfEnumItem( CUrlfFolder *phf, DWORD uFlags )
{
m_iCount = 0;
m_uFlags = uFlags;
m_phfThis = phf;
phf->AddRef();
}
/*-------------------------------------------------------------------*/
// Procedure....: ~CUrlfEnumItem()
// Description..: Destructor of the class
/*-------------------------------------------------------------------*/
CUrlfEnumItem::~CUrlfEnumItem()
{
m_phfThis->Release();
}
/*-------------------------------------------------------------------*/
// Procedure....: ::QueryInterface()
// Description..: return a pointer to the specified interface
/*-------------------------------------------------------------------*/
STDMETHODIMP CUrlfEnumItem::QueryInterface( REFIID riid, LPVOID FAR *ppv )
{
if( IsEqualIID(riid, IID_IUnknown) )
{
*ppv = (IUnknown *) this;
m_cRef++;
return NOERROR;
}
else
if( IsEqualIID(riid, IID_IEnumIDList) )
{
*ppv = (IEnumIDList *) this;
m_cRef++;
return NOERROR;
}
else
{
*ppv = NULL;
return ResultFromScode( E_NOINTERFACE );
}
}
/*-------------------------------------------------------------------*/
// Procedure....: ::AddRef()
// Description..: increase the reference count for the server
/*-------------------------------------------------------------------*/
STDMETHODIMP_(ULONG) CUrlfEnumItem::AddRef()
{
return ++m_cRef;
}
/*-------------------------------------------------------------------*/
// Procedure....: ::Release()
// Description..: decrease the reference count for the server
/*-------------------------------------------------------------------*/
STDMETHODIMP_(ULONG) CUrlfEnumItem::Release()
{
if( --m_cRef==0 )
delete this;
return m_cRef;
}
// IMPLEMENTED
// IEnumIDList methods
//
// - Next
// - Reset
/*-------------------------------------------------------------------*/
// Procedure....: Reset()
// Description..: Reset the enumeration
/*-------------------------------------------------------------------*/
STDMETHODIMP CUrlfEnumItem::Reset()
{
m_iCount = 0;
return NOERROR;
}
/*-------------------------------------------------------------------*/
// Procedure....: Next()
// Description..: Returns the next item in the list
/*-------------------------------------------------------------------*/
STDMETHODIMP CUrlfEnumItem::Next( ULONG celt, LPITEMIDLIST *rgelt,
ULONG *pceltFetched )
{
return S_OK;
}
// UNIMPLEMENTED
// IEnumIDList methods
//
// - Skip
// - Clone
/*-------------------------------------------------------------------*/
// Procedure....: Skip()
// Description..:
/*-------------------------------------------------------------------*/
STDMETHODIMP CUrlfEnumItem::Skip( ULONG celt )
{
return E_NOTIMPL;
}
/*-------------------------------------------------------------------*/
// Procedure....: Clone()
// Description..:
/*-------------------------------------------------------------------*/
STDMETHODIMP CUrlfEnumItem::Clone( IEnumIDList **ppenum )
{
return E_NOTIMPL;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -