implementation of IEnumFORMATETC interface More...
#include <dragdropimpl.h>


Public Member Functions | |
| EnumFormatEtcImpl (const FormatArray &ArrFE) | |
| EnumFormatEtcImpl (const StorageArray &ArrFE) | |
| virtual | ~EnumFormatEtcImpl () |
| virtual HRESULT STDMETHODCALLTYPE | Next (ULONG, LPFORMATETC, ULONG *) |
| virtual HRESULT STDMETHODCALLTYPE | Skip (ULONG) |
| virtual HRESULT STDMETHODCALLTYPE | Reset (void) |
| virtual HRESULT STDMETHODCALLTYPE | Clone (IEnumFORMATETC **) |
implementation of IEnumFORMATETC interface
Definition at line 27 of file dragdropimpl.h.
| EnumFormatEtcImpl::EnumFormatEtcImpl | ( | const FormatArray & | ArrFE ) |
Definition at line 254 of file dragdropimpl.cpp.
Referenced by Clone().
: super(IID_IEnumFORMATETC),
m_cRefCount(0),
m_iCur(0)
{
for(FormatArray::const_iterator it=ArrFE.begin(); it!=ArrFE.end(); ++it)
m_pFmtEtc.push_back(*it);
}

| EnumFormatEtcImpl::EnumFormatEtcImpl | ( | const StorageArray & | ArrFE ) |
Definition at line 263 of file dragdropimpl.cpp.
: super(IID_IEnumFORMATETC),
m_cRefCount(0),
m_iCur(0)
{
for(StorageArray::const_iterator it=ArrFE.begin(); it!=ArrFE.end(); ++it)
m_pFmtEtc.push_back(*it->_format);
}
| virtual EnumFormatEtcImpl::~EnumFormatEtcImpl | ( | ) | [inline, virtual] |
Definition at line 40 of file dragdropimpl.h.
{}
| STDMETHODIMP EnumFormatEtcImpl::Clone | ( | IEnumFORMATETC ** | ppCloneEnumFormatEtc ) | [virtual] |
Definition at line 311 of file dragdropimpl.cpp.
References EnumFormatEtcImpl().
{
if (ppCloneEnumFormatEtc == NULL)
return E_POINTER;
EnumFormatEtcImpl* newEnum = new EnumFormatEtcImpl(m_pFmtEtc);
if (!newEnum)
return E_OUTOFMEMORY;
newEnum->AddRef();
newEnum->m_iCur = m_iCur;
*ppCloneEnumFormatEtc = newEnum;
return S_OK;
}

| STDMETHODIMP EnumFormatEtcImpl::Next | ( | ULONG | celt, |
| LPFORMATETC | lpFormatEtc, | ||
| ULONG * | pceltFetched | ||
| ) | [virtual] |
Definition at line 272 of file dragdropimpl.cpp.
{
if (pceltFetched != NULL)
*pceltFetched=0;
ULONG cReturn = celt;
if (celt <= 0 || lpFormatEtc == NULL || m_iCur >= m_pFmtEtc.size())
return S_FALSE;
if (pceltFetched == NULL && celt != 1) // pceltFetched can be NULL only for 1 item request
return S_FALSE;
while (m_iCur < m_pFmtEtc.size() && cReturn > 0)
{
*lpFormatEtc++ = m_pFmtEtc[m_iCur++];
--cReturn;
}
if (pceltFetched != NULL)
*pceltFetched = celt - cReturn;
return (cReturn == 0) ? S_OK : S_FALSE;
}
| STDMETHODIMP EnumFormatEtcImpl::Reset | ( | void | ) | [virtual] |
Definition at line 305 of file dragdropimpl.cpp.
{
m_iCur = 0;
return S_OK;
}
| STDMETHODIMP EnumFormatEtcImpl::Skip | ( | ULONG | celt ) | [virtual] |
Definition at line 296 of file dragdropimpl.cpp.
{
if ((m_iCur + int(celt)) >= m_pFmtEtc.size())
return S_FALSE;
m_iCur += celt;
return S_OK;
}
|
ROS Explorer Source Code Documentation
generated on 02.01.2013 by
|