Esempio n. 1
0
// @pymethod int|PyIShellView|TranslateAccelerator|Description of TranslateAccelerator.
PyObject *PyIShellView::TranslateAccelerator(PyObject *self, PyObject *args)
{
	IShellView *pISV = GetI(self);
	if ( pISV == NULL )
		return NULL;
	MSG msg;
	PyObject *obpmsg;
	// @pyparm tuple|pmsg||Description for pmsg
	if ( !PyArg_ParseTuple(args, "O:TranslateAccelerator", &obpmsg) )
		return NULL;
	BOOL bPythonIsHappy = TRUE;
	if (bPythonIsHappy && !PyObject_AsMSG( obpmsg, &msg )) bPythonIsHappy = FALSE;
	if (!bPythonIsHappy) return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pISV->TranslateAccelerator( &msg );
	PY_INTERFACE_POSTCALL;
	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pISV, IID_IShellView );
	// @rdesc The result is the HRESULT from the underlying TranslateAccelerator call
	return PyInt_FromLong(hr);
}