本文整理汇总了C++中IPropertyStorage::WritePropertyNames方法的典型用法代码示例。如果您正苦于以下问题:C++ IPropertyStorage::WritePropertyNames方法的具体用法?C++ IPropertyStorage::WritePropertyNames怎么用?C++ IPropertyStorage::WritePropertyNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyStorage
的用法示例。
在下文中一共展示了IPropertyStorage::WritePropertyNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetI
// @pymethod |PyIPropertyStorage|WritePropertyNames|Assigns string names to a specified array of property IDs in the current property set.
PyObject *PyIPropertyStorage::WritePropertyNames(PyObject *self, PyObject *args)
{
IPropertyStorage *pIPS = GetI(self);
if ( pIPS == NULL )
return NULL;
PyObject *obProps;
PyObject *obNames;
// @pyparm (int, ...)|props||Sequence containing the property IDs.
// @pyparm (string, ...)|names||Equal length sequence of property names.
if ( !PyArg_ParseTuple(args, "OO:WritePropertyNames", &obProps, &obNames))
return NULL;
ULONG cProps = 0, cNames=0;
PROPID *pProps = NULL;
LPWSTR *ppStrs = NULL;
PyObject *rc = NULL;
if (!PyObject_AsPROPIDs( obProps, &pProps, &cProps))
return NULL;
if (!PyWinObject_AsWCHARArray(obNames, &ppStrs, &cNames, FALSE))
goto done;
if (cNames != cProps) {
PyErr_SetString(PyExc_TypeError, "Property names must be a sequence the same size as property ids");
goto done;
}
HRESULT hr;
{
PY_INTERFACE_PRECALL;
hr = pIPS->WritePropertyNames( cProps, pProps, ppStrs );
PY_INTERFACE_POSTCALL;
}
if ( FAILED(hr) )
PyCom_BuildPyException(hr, pIPS, IID_IPropertyStorage);
else{
Py_INCREF(Py_None);
rc = Py_None;
}
done:
PyObject_FreePROPIDs(pProps, cProps);
PyWinObject_FreeWCHARArray(ppStrs, cNames);
return rc;
}