Esempio n. 1
0
// @pymethod |PyIContext|RemoveProperty|Removes a property from the context
PyObject *PyIContext::RemoveProperty(PyObject *self, PyObject *args)
{
	IContext *pIC = GetI(self);
	if ( pIC == NULL )
		return NULL;
	// @pyparm <o PyIID>|rPolicyId||GUID that identifies a context property
	PyObject *obrPolicyId;
	IID rPolicyId;
	if ( !PyArg_ParseTuple(args, "O:RemoveProperty", &obrPolicyId) )
		return NULL;
	if (!PyWinObject_AsIID(obrPolicyId, &rPolicyId))
		return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pIC->RemoveProperty( rPolicyId );
	PY_INTERFACE_POSTCALL;

	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pIC, IID_IContext );
	Py_INCREF(Py_None);
	return Py_None;
}