HRESULT __stdcall CDataObject::EnumFormatEtc (DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc) { if(dwDirection == DATADIR_GET) { return SHCreateStdEnumFmtEtc(m_nNumFormats, m_pFormatEtc, ppEnumFormatEtc); } else { return E_NOTIMPL; } }
HRESULT __stdcall CMyDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc) { if (dwDirection == DATADIR_GET) { // Windows 2000 and newer only. return SHCreateStdEnumFmtEtc(1, &m_FormatEtc, ppEnumFormatEtc); //return CreateEnumFmtEtc(1,&m_FormatEtc,ppEnumFormatEtc); } else { return E_NOTIMPL; } }
HRESULT STDMETHODCALLTYPE DataObjectImpl::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc) { if (dwDirection == DATADIR_GET) { unsigned count = m_contents.get_count(); pfc::array_staticsize_t<FORMATETC> fmt(count); for (unsigned i = 0; i < count; i++) { fmt[i] = m_contents[i]->formatEtc; } return SHCreateStdEnumFmtEtc(m_contents.get_count(), fmt.get_ptr(), ppenumFormatEtc); } return E_NOTIMPL; }
static HRESULT STDMETHODCALLTYPE CDevSettings_EnumFormatEtc(IDataObject* iface, DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc) { HRESULT hr; FORMATETC fetc[9]; PCDevSettings This = impl_from_IDataObject(iface); *ppenumFormatEtc = NULL; if (dwDirection == DATADIR_GET) { pCDevSettings_FillFormatEtc(&fetc[0], This->cfExtInterface); pCDevSettings_FillFormatEtc(&fetc[1], This->cfDisplayDevice); pCDevSettings_FillFormatEtc(&fetc[2], This->cfDisplayName); pCDevSettings_FillFormatEtc(&fetc[3], This->cfDisplayId); pCDevSettings_FillFormatEtc(&fetc[4], This->cfDisplayKey); pCDevSettings_FillFormatEtc(&fetc[5], This->cfDisplayStateFlags); pCDevSettings_FillFormatEtc(&fetc[6], This->cfMonitorName); pCDevSettings_FillFormatEtc(&fetc[7], This->cfMonitorDevice); pCDevSettings_FillFormatEtc(&fetc[8], This->cfPruningMode); hr = SHCreateStdEnumFmtEtc(sizeof(fetc) / sizeof(fetc[0]), fetc, ppenumFormatEtc); } else hr = E_NOTIMPL; return hr; }