本文整理汇总了C++中IPropertyStorage::SetTimes方法的典型用法代码示例。如果您正苦于以下问题:C++ IPropertyStorage::SetTimes方法的具体用法?C++ IPropertyStorage::SetTimes怎么用?C++ IPropertyStorage::SetTimes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyStorage
的用法示例。
在下文中一共展示了IPropertyStorage::SetTimes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyCom_BuildPyException
// @pymethod |PyIPropertyStorage|SetTimes|Sets the creation, last access, and modification time
// @comm Some property sets do not support these times.
PyObject *PyIPropertyStorage::SetTimes(PyObject *self, PyObject *args)
{
IPropertyStorage *pIPS = GetI(self);
if ( pIPS == NULL )
return NULL;
// @pyparm <o PyTime>|ctime||Creation time, or None for no change
// @pyparm <o PyTime>|atime||Last access time, or None for no change
// @pyparm <o PyTime>|mtime||Modification time, or None for no change
PyObject *obctime;
PyObject *obatime;
PyObject *obmtime;
FILETIME ctime, *pctime=NULL;
FILETIME atime, *patime=NULL;
FILETIME mtime, *pmtime=NULL;
if ( !PyArg_ParseTuple(args, "OOO:SetTimes", &obctime, &obatime, &obmtime) )
return NULL;
if (obctime != Py_None){
if (!PyWinObject_AsFILETIME(obctime, &ctime))
return NULL;
pctime = &ctime;
}
if (obatime != Py_None){
if (!PyWinObject_AsFILETIME(obatime, &atime))
return NULL;
patime = &atime;
}
if (obmtime != Py_None){
if (!PyWinObject_AsFILETIME(obmtime, &mtime))
return NULL;
pmtime = &mtime;
}
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIPS->SetTimes(pctime, patime, pmtime);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIPS, IID_IPropertyStorage);
Py_INCREF(Py_None);
return Py_None;
}