本文整理汇总了C++中IPropertyStorage::Enum方法的典型用法代码示例。如果您正苦于以下问题:C++ IPropertyStorage::Enum方法的具体用法?C++ IPropertyStorage::Enum怎么用?C++ IPropertyStorage::Enum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyStorage
的用法示例。
在下文中一共展示了IPropertyStorage::Enum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyCom_BuildPyException
// @pymethod <o PyIEnumSTATPROPSTG>|PyIPropertyStorage|Enum|Creates an enumerator for properties in the property set
PyObject *PyIPropertyStorage::Enum(PyObject *self, PyObject *args)
{
IPropertyStorage *pIPS = GetI(self);
if ( pIPS == NULL )
return NULL;
IEnumSTATPROPSTG * ppenum;
if ( !PyArg_ParseTuple(args, ":Enum") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIPS->Enum( &ppenum );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIPS, IID_IPropertyStorage);
return PyCom_PyObjectFromIUnknown(ppenum, IID_IEnumSTATPROPSTG, FALSE);
}
示例2: GetProperties
//.........这里部分代码省略.........
// Headings:
// =========
// 0 - General
// 2 - Mesh Totals
// 4 - Scene Totals
// 6 - External Dependencies
// 8 - Objects
// 10 - Materials
// 12 - Plug-Ins
int nDocPart = 0;
for (UINT i=0; i<pHeading->cElems; i+=2) {
SendMessage(GetDlgItem(hPropDialog, IDC_CONTENTS), LB_ADDSTRING, 0, (LPARAM)pHeading->pElems[i].pszVal);
for (int j=0; j<pHeading->pElems[i+1].lVal; j++) {
sprintf(szBuf, "\t%s", pDocPart->pElems[nDocPart]);
SendMessage(GetDlgItem(hPropDialog, IDC_CONTENTS), LB_ADDSTRING, 0, (LPARAM)szBuf);
nDocPart++;
}
}
}
}
FreePropVariantArray(5, PropVar);
pDocumentSummaryInfoStorage->Release();
}
if (S_OK == pPropertySetStorage->Open(FMTID_UserDefinedProperties, STGM_READ|STGM_SHARE_EXCLUSIVE, &pUserDefinedPropertyStorage)) {
int numUserProps = 0;
// First we need to count the properties
IEnumSTATPROPSTG* pIPropertyEnum;
if (S_OK == pUserDefinedPropertyStorage->Enum(&pIPropertyEnum)) {
STATPROPSTG property;
while (pIPropertyEnum->Next(1, &property, NULL) == S_OK) {
if (property.lpwstrName) {
CoTaskMemFree(property.lpwstrName);
property.lpwstrName = NULL;
numUserProps++;
}
}
PROPSPEC* pPropSpec = new PROPSPEC[numUserProps];
PROPVARIANT* pPropVar = new PROPVARIANT[numUserProps];
ZeroMemory(pPropVar, numUserProps*sizeof(PROPVARIANT));
ZeroMemory(pPropSpec, numUserProps*sizeof(PROPSPEC));
pIPropertyEnum->Reset();
int idx = 0;
while (pIPropertyEnum->Next(1, &property, NULL) == S_OK) {
if (property.lpwstrName) {
pPropSpec[idx].ulKind = PRSPEC_LPWSTR;
pPropSpec[idx].lpwstr = (LPWSTR)CoTaskMemAlloc(sizeof(wchar_t)*(wcslen(property.lpwstrName)+1));
wcscpy(pPropSpec[idx].lpwstr, property.lpwstrName);
idx++;
CoTaskMemFree(property.lpwstrName);
property.lpwstrName = NULL;
}
}
pIPropertyEnum->Release();
ListView_DeleteAllItems(GetDlgItem(hPropDialog, IDC_CUSTOM));
HRESULT hr = pUserDefinedPropertyStorage->ReadMultiple(idx, pPropSpec, pPropVar);