{ { "ReadAt", PyILockBytes::ReadAt, 1 }, // @pymeth ReadAt|Reads a specified number of bytes starting at a specified offset from the beginning of the byte array object. { "WriteAt", PyILockBytes::WriteAt, 1 }, // @pymeth WriteAt|Writes the specified number of bytes starting at a specified offset from the beginning of the byte array. { "Flush", PyILockBytes::Flush, 1 }, // @pymeth Flush|Ensures that any internal buffers maintained by the byte array object are written out to the backing storage. { "SetSize", PyILockBytes::SetSize, 1 }, // @pymeth SetSize|Changes the size of the byte array. { "LockRegion", PyILockBytes::LockRegion, 1 }, // @pymeth LockRegion|Restricts access to a specified range of bytes in the byte array. { "UnlockRegion", PyILockBytes::UnlockRegion, 1 }, // @pymeth UnlockRegion|Removes the access restriction on a range of bytes previously restricted with <om PyILockBytes.LockRegion>. { "Stat", PyILockBytes::Stat, 1 }, // @pymeth Stat|Retrieves a <o STATSTG> structure for this byte array object. { NULL } }; PyComTypeObject PyILockBytes::type("PyILockBytes", &PyIUnknown::type, // @base PyILockBytes|PyIUnknown sizeof(PyILockBytes), PyILockBytes_methods, GET_PYCOM_CTOR(PyILockBytes)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGLockBytes::ReadAt( /* [in] */ ULARGE_INTEGER ulOffset, /* [in] */ void __RPC_FAR * pv, /* [in] */ ULONG cb, /* [out] */ ULONG __RPC_FAR * pcbRead) { if (pv==NULL) return E_POINTER; if (pcbRead) *pcbRead = 0; PY_GATEWAY_METHOD; PyObject *obulOffset = PyWinObject_FromULARGE_INTEGER(ulOffset);
// @object PyIEnumDebugCodeContexts|A Python interface to IEnumDebugCodeContexts static struct PyMethodDef PyIEnumDebugCodeContexts_methods[] = { { "Next", PyIEnumDebugCodeContexts::Next, 1 }, // @pymeth Next|Retrieves a specified number of items in the enumeration sequence. { "Skip", PyIEnumDebugCodeContexts::Skip, 1 }, // @pymeth Skip|Skips over the next specified elementes. { "Reset", PyIEnumDebugCodeContexts::Reset, 1 }, // @pymeth Reset|Resets the enumeration sequence to the beginning. { "Clone", PyIEnumDebugCodeContexts::Clone, 1 }, // @pymeth Clone|Creates another enumerator that contains the same enumeration state as the current one. { NULL } }; PyComTypeObject PyIEnumDebugCodeContexts::type("PyIEnumDebugCodeContexts", &PyIUnknown::type, sizeof(PyIEnumDebugCodeContexts), PyIEnumDebugCodeContexts_methods, GET_PYCOM_CTOR(PyIEnumDebugCodeContexts)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGEnumDebugCodeContexts::Next( /* [in] */ ULONG celt, /* [length_is][size_is][out] */ IDebugCodeContext __RPC_FAR * __RPC_FAR *rgVar, /* [out] */ ULONG __RPC_FAR *pCeltFetched) { PY_GATEWAY_METHOD; PyObject *result; Py_ssize_t len; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) )
if ( pIPSPS == NULL ) return NULL; PUSERIALIZEDPROPSTORAGE buf; DWORD bufsize; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIPSPS->GetPropertyStorage(&buf, &bufsize); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIPSPS, IID_IPersistSerializedPropStorage ); PyObject *ret = PyString_FromStringAndSize((char *)buf, bufsize); CoTaskMemFree(buf); return ret; } // @object PyIPersistSerializedPropStorage|Allows a property store to be marshalled into a single buffer. // Primarily used with property stores created using <om propsys.PSCreateMemoryPropertyStore>. static struct PyMethodDef PyIPersistSerializedPropStorage_methods[] = { { "SetFlags", PyIPersistSerializedPropStorage::SetFlags, 1 }, // @pymeth SetFlags|Sets flags for the store { "SetPropertyStorage", PyIPersistSerializedPropStorage::SetPropertyStorage, 1 }, // @pymeth SetPropertyStorage|Initializes the store with a serialized buffer { "GetPropertyStorage", PyIPersistSerializedPropStorage::GetPropertyStorage, METH_NOARGS }, // @pymeth GetPropertyStorage|Retrieves the current contents of the property store { NULL } }; PyComTypeObject PyIPersistSerializedPropStorage::type("PyIPersistSerializedPropStorage", &PyIUnknown::type, sizeof(PyIPersistSerializedPropStorage), PyIPersistSerializedPropStorage_methods, GET_PYCOM_CTOR(PyIPersistSerializedPropStorage));
{ "SynchronousCallInDebuggerThread", PyIDebugApplication::SynchronousCallInDebuggerThread, 1 }, // @pymeth SynchronousCallInDebuggerThread|Provides a mechanism for the caller to run code in the debugger thread. { "CreateApplicationNode", PyIDebugApplication::CreateApplicationNode, 1 }, // @pymeth CreateApplicationNode|Creates a new application node which is associated with a specific document provider. { "FireDebuggerEvent", PyIDebugApplication::FireDebuggerEvent, 1 }, // @pymeth FireDebuggerEvent|Fire a generic event to the IApplicationDebugger (if any) { "HandleRuntimeError", PyIDebugApplication::HandleRuntimeError, 1 }, // @pymeth HandleRuntimeError|Description of HandleRuntimeError { "FCanJitDebug", PyIDebugApplication::FCanJitDebug, 1 }, // @pymeth FCanJitDebug|Description of FCanJitDebug { "FIsAutoJitDebugEnabled", PyIDebugApplication::FIsAutoJitDebugEnabled, 1 }, // @pymeth FIsAutoJitDebugEnabled|Description of FIsAutoJitDebugEnabled { "AddGlobalExpressionContextProvider", PyIDebugApplication::AddGlobalExpressionContextProvider, 1 }, // @pymeth AddGlobalExpressionContextProvider|Description of AddGlobalExpressionContextProvider { "RemoveGlobalExpressionContextProvider", PyIDebugApplication::RemoveGlobalExpressionContextProvider, 1 }, // @pymeth RemoveGlobalExpressionContextProvider|Description of RemoveGlobalExpressionContextProvider { NULL } }; PyComTypeObject PyIDebugApplication::type("PyIDebugApplication", &PyIRemoteDebugApplication::type, sizeof(PyIDebugApplication), PyIDebugApplication_methods, GET_PYCOM_CTOR(PyIDebugApplication)); // --------------------------------------------------- // // Gateway Implementation // Std delegation STDMETHODIMP PyGDebugApplication::ResumeFromBreakPoint(IRemoteDebugApplicationThread * prptFocus, BREAKRESUMEACTION bra, ERRORRESUMEACTION era) {return PyGRemoteDebugApplication::ResumeFromBreakPoint(prptFocus, bra, era);} STDMETHODIMP PyGDebugApplication::CauseBreak(void) {return PyGRemoteDebugApplication::CauseBreak();} STDMETHODIMP PyGDebugApplication::ConnectDebugger(IApplicationDebugger * pad) {return PyGRemoteDebugApplication::ConnectDebugger(pad);} STDMETHODIMP PyGDebugApplication::DisconnectDebugger() {return PyGRemoteDebugApplication::DisconnectDebugger();} STDMETHODIMP PyGDebugApplication::GetDebugger(IApplicationDebugger ** pad) {return PyGRemoteDebugApplication::GetDebugger(pad);} STDMETHODIMP PyGDebugApplication::CreateInstanceAtApplication(REFCLSID rclsid,IUnknown * pUnkOuter,DWORD dwClsContext,REFIID riid,IUnknown ** ppvObject) {return PyGRemoteDebugApplication::CreateInstanceAtApplication(rclsid, pUnkOuter,dwClsContext,riid,ppvObject);} STDMETHODIMP PyGDebugApplication::QueryAlive() {return PyGRemoteDebugApplication::QueryAlive();} STDMETHODIMP PyGDebugApplication::EnumThreads(IEnumRemoteDebugApplicationThreads** pperdat) {return PyGRemoteDebugApplication::EnumThreads(pperdat);} STDMETHODIMP PyGDebugApplication::GetName(BSTR * pbstrName) {return PyGRemoteDebugApplication::GetName(pbstrName);}
// @object PyIEnumConnectionPoints|A Python interface to IEnumConnectionPoints static struct PyMethodDef PyIEnumConnectionPoints_methods[] = { { "Next", PyIEnumConnectionPoints::Next, 1 }, // @pymeth Next|Retrieves a specified number of items in the enumeration sequence. { "Skip", PyIEnumConnectionPoints::Skip, 1 }, // @pymeth Skip|Skips over the next specified elementes. { "Reset", PyIEnumConnectionPoints::Reset, 1 }, // @pymeth Reset|Resets the enumeration sequence to the beginning. { "Clone", PyIEnumConnectionPoints::Clone, 1 }, // @pymeth Clone|Creates another enumerator that contains the same enumeration state as the current one. { NULL } }; PyComEnumTypeObject PyIEnumConnectionPoints::type("PyIEnumConnectionPoints", &PyIUnknown::type, // @base PyIEnumConnectionPoints|PyIUnknown sizeof(PyIEnumConnectionPoints), PyIEnumConnectionPoints_methods, GET_PYCOM_CTOR(PyIEnumConnectionPoints)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGEnumConnectionPoints::Next( /* [in] */ ULONG celt, /* [length_is][size_is][out] */ IConnectionPoint **rgVar, /* [out] */ ULONG __RPC_FAR *pCeltFetched) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) return hr;
IConnectionPoint *pICP = GetI(self); if ( pICP == NULL ) return NULL; IEnumConnections *p; PY_INTERFACE_PRECALL; HRESULT hr = pICP->EnumConnections(&p); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return SetPythonCOMError(self,hr); return PyCom_PyObjectFromIUnknown(p, IID_IEnumConnections, FALSE); } // @object PyIConnectionPoint|A Python wrapper of a COM IConnectionPoint interface. static struct PyMethodDef PyIConnectionPoint_methods[] = { { "GetConnectionInterface", PyIConnectionPoint::GetConnectionInterface, 1 }, // @pymeth GetConnectionInterface|Retrieves the IID of the interface represented by the connection point. { "GetConnectionPointContainer", PyIConnectionPoint::GetConnectionPointContainer, 1 }, // @pymeth GetConnectionPointContainer|Gets the connection point container for the object. { "Advise", PyIConnectionPoint::Advise, 1 }, // @pymeth Advise|Establishes a connection between the connection point object and the client's sink. { "Unadvise", PyIConnectionPoint::Unadvise, 1 }, // @pymeth Unadvise|Terminates an advisory connection previously established through <om PyIConnectionPoint::Advise>. { "EnumConnections", PyIConnectionPoint::EnumConnections, 1 }, // @pymeth EnumConnections|Creates an enumerator to iterate through the connections for the connection point { NULL } }; PyComTypeObject PyIConnectionPoint::type("PyIConnectionPoint", &PyIUnknown::type, // @base PyIConnectionPoint|PyIUnknown sizeof(PyIConnectionPoint), PyIConnectionPoint_methods, GET_PYCOM_CTOR(PyIConnectionPoint));
{ { "GetDocumentAttributes", PyIDebugDocumentText::GetDocumentAttributes, 1 }, // @pymeth GetDocumentAttributes|Description of GetDocumentAttributes { "GetSize", PyIDebugDocumentText::GetSize, 1 }, // @pymeth GetSize|Description of GetSize { "GetPositionOfLine", PyIDebugDocumentText::GetPositionOfLine, 1 }, // @pymeth GetPositionOfLine|Description of GetPositionOfLine { "GetLineOfPosition", PyIDebugDocumentText::GetLineOfPosition, 1 }, // @pymeth GetLineOfPosition|Description of GetLineOfPosition { "GetText", PyIDebugDocumentText::GetText, 1 }, // @pymeth GetText|Description of GetText { "GetPositionOfContext", PyIDebugDocumentText::GetPositionOfContext, 1 }, // @pymeth GetPositionOfContext|Description of GetPositionOfContext { "GetContextOfPosition", PyIDebugDocumentText::GetContextOfPosition, 1 }, // @pymeth GetContextOfPosition|Description of GetContextOfPosition { NULL } }; PyComTypeObject PyIDebugDocumentText::type("PyIDebugDocumentText", &PyIDebugDocument::type, sizeof(PyIDebugDocumentText), PyIDebugDocumentText_methods, GET_PYCOM_CTOR(PyIDebugDocumentText)); // --------------------------------------------------- // // Gateway Implementation // Std delegation // IDebugDocumentInfo STDMETHODIMP PyGDebugDocumentText::GetName(DOCUMENTNAMETYPE dnt, BSTR *pbstrName) {return PyGDebugDocument::GetName(dnt, pbstrName);} STDMETHODIMP PyGDebugDocumentText::GetDocumentClassId(CLSID *pclsidDocument) {return PyGDebugDocument::GetDocumentClassId(pclsidDocument);} // IDebugDocument STDMETHODIMP PyGDebugDocumentText::GetDocumentAttributes( /* [out] */ TEXT_DOC_ATTR __RPC_FAR * ptextdocattr) {
{ "GetDataHere", PyIDataObject::GetDataHere, 1 }, // @pymeth GetDataHere|Returns a copy of the object's data in specified format { "QueryGetData", PyIDataObject::QueryGetData, 1 }, // @pymeth QueryGetData|Checks if the object supports returning data in a particular format { "GetCanonicalFormatEtc", PyIDataObject::GetCanonicalFormatEtc, 1 }, // @pymeth GetCanonicalFormatEtc|Transforms a FORMATECT data description into a general format that the object supports { "SetData", PyIDataObject::SetData, 1 }, // @pymeth SetData|Sets the data that the object will return. { "EnumFormatEtc", PyIDataObject::EnumFormatEtc, 1 }, // @pymeth EnumFormatEtc|Returns an enumerator to list the data formats that the object supports. { "DAdvise", PyIDataObject::DAdvise, 1 }, // @pymeth DAdvise|Connects the object to an interface that will receive notifications when its data changes { "DUnadvise", PyIDataObject::DUnadvise, 1 }, // @pymeth DUnadvise|Disconnects a notification sink. { "EnumDAdvise", PyIDataObject::EnumDAdvise, 1 }, // @pymeth EnumDAdvise|Creates an enumerator to list connected notification sinks. { NULL } }; PyComEnumProviderTypeObject PyIDataObject::type("PyIDataObject", &PyIUnknown::type, sizeof(PyIDataObject), PyIDataObject_methods, GET_PYCOM_CTOR(PyIDataObject), "EnumFormatEtc"); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGDataObject::GetData( /* [unique][in] */ FORMATETC * pformatetcIn, /* [out] */ STGMEDIUM * pmedium) { static const char *method_name = "GetData"; if (!pmedium) return E_POINTER; PY_GATEWAY_METHOD; PyObject *obpformatetcIn = PyObject_FromFORMATETC(pformatetcIn); if (obpformatetcIn==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); PyObject *result;
// @object PyIEnumIDList|A Python interface to IEnumIDList static struct PyMethodDef PyIEnumIDList_methods[] = { { "Next", PyIEnumIDList::Next, 1 }, // @pymeth Next|Retrieves a specified number of items in the enumeration sequence. { "Skip", PyIEnumIDList::Skip, 1 }, // @pymeth Skip|Skips over the next specified elementes. { "Reset", PyIEnumIDList::Reset, 1 }, // @pymeth Reset|Resets the enumeration sequence to the beginning. { "Clone", PyIEnumIDList::Clone, 1 }, // @pymeth Clone|Creates another enumerator that contains the same enumeration state as the current one. { NULL } }; PyComEnumTypeObject PyIEnumIDList::type("PyIEnumIDList", &PyIUnknown::type, sizeof(PyIEnumIDList), PyIEnumIDList_methods, GET_PYCOM_CTOR(PyIEnumIDList)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGEnumIDList::Next( /* [in] */ ULONG celt, /* [length_is][size_is][out] */ LPITEMIDLIST *pi, /* [out] */ ULONG __RPC_FAR *pCeltFetched) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) return hr;
// @object PyIEnumSTATSTG|An enumerator for elements contained in a <o PyIStorage> object static struct PyMethodDef PyIEnumSTATSTG_methods[] = { { "Next", PyIEnumSTATSTG::Next, 1 }, // @pymeth Next|Retrieves a specified number of items in the enumeration sequence. { "Skip", PyIEnumSTATSTG::Skip, 1 }, // @pymeth Skip|Skips over the next specified elementes. { "Reset", PyIEnumSTATSTG::Reset, 1 }, // @pymeth Reset|Resets the enumeration sequence to the beginning. { "Clone", PyIEnumSTATSTG::Clone, 1 }, // @pymeth Clone|Creates another enumerator that contains the same enumeration state as the current one. { NULL } }; PyComEnumTypeObject PyIEnumSTATSTG::type("PyIEnumSTATSTG", &PyIUnknown::type, // @base PyIEnumStatSTG|PyIUnknown sizeof(PyIEnumSTATSTG), PyIEnumSTATSTG_methods, GET_PYCOM_CTOR(PyIEnumSTATSTG)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGEnumSTATSTG::Next( /* [in] */ ULONG celt, /* [length_is][size_is][out] */ STATSTG __RPC_FAR *rgVar, /* [out] */ ULONG __RPC_FAR *pCeltFetched) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) return hr;
hr = pIPS->RefreshPropertySchema( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIPS, IID_IPropertySystem ); Py_INCREF(Py_None); return Py_None; } // @object PyIPropertySystem|Wraps the IPropertySystem interface static struct PyMethodDef PyIPropertySystem_methods[] = { { "GetPropertyDescription", PyIPropertySystem::GetPropertyDescription, 1 }, // @pymeth GetPropertyDescription|Returns an interface used to describe a property { "GetPropertyDescriptionByName", PyIPropertySystem::GetPropertyDescriptionByName, 1 }, // @pymeth GetPropertyDescriptionByName|Returns an interface used to describe a property { "GetPropertyDescriptionListFromString", PyIPropertySystem::GetPropertyDescriptionListFromString, 1 }, // @pymeth GetPropertyDescriptionListFromString|Retrieves property descriptions from a string of property names { "EnumeratePropertyDescriptions", PyIPropertySystem::EnumeratePropertyDescriptions, 1 }, // @pymeth EnumeratePropertyDescriptions|Returns an interface used to list defined properties { "FormatForDisplay", PyIPropertySystem::FormatForDisplay, 1 }, // @pymeth FormatForDisplay|Formats a property into a string { "RegisterPropertySchema", PyIPropertySystem::RegisterPropertySchema, 1 }, // @pymeth RegisterPropertySchema|Registers a set of properties defined in a .propdesc file { "UnregisterPropertySchema", PyIPropertySystem::UnregisterPropertySchema, 1 }, // @pymeth UnregisterPropertySchema|Removes a set of registered properties { "RefreshPropertySchema", PyIPropertySystem::RefreshPropertySchema, 1 }, // @pymeth RefreshPropertySchema|Not currently implemented by the OS { NULL } }; PyComTypeObject PyIPropertySystem::type("PyIPropertySystem", &PyIUnknown::type, sizeof(PyIPropertySystem), PyIPropertySystem_methods, GET_PYCOM_CTOR(PyIPropertySystem));
// @pyparm <o PyHANDLE>|hwnd||Handle to window, should have WS_CAPTION style if ( !PyArg_ParseTuple(args, "O&:SetActiveAlt", PyWinObject_AsHANDLE, &hwnd)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pITL->SetActiveAlt( hwnd ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pITL, IID_ITaskbarList ); Py_INCREF(Py_None); return Py_None; } // @object PyITaskbarList|Description of the interface static struct PyMethodDef PyITaskbarList_methods[] = { { "HrInit", PyITaskbarList::HrInit, METH_NOARGS }, // @pymeth HrInit|Intializes the interface before use { "AddTab", PyITaskbarList::AddTab, 1 }, // @pymeth AddTab|Places a window on the taskbar { "DeleteTab", PyITaskbarList::DeleteTab, 1 }, // @pymeth DeleteTab|Removes a window from the taskbar { "ActivateTab", PyITaskbarList::ActivateTab, 1 }, // @pymeth ActivateTab|Marks a window as the active tab on the taskbar { "SetActiveAlt", PyITaskbarList::SetActiveAlt, 1 }, // @pymeth SetActiveAlt|Sets the window as the active tab, without displaying it as pressed on the taskbar { NULL } }; PyComTypeObject PyITaskbarList::type("PyITaskbarList", &PyIUnknown::type, sizeof(PyITaskbarList), PyITaskbarList_methods, GET_PYCOM_CTOR(PyITaskbarList));
TASKPAGE tpType; // @pyparm int|tpType||Type of page to retreive (TASKPAGE_TASK,TASKPAGE_SCHEDULE,TASKPAGE_SETTINGS) // @pyparm bool|PersistChanges||Indicates if changes should be saved automatically HPROPSHEETPAGE phPage; BOOL bPersistChanges; if ( !PyArg_ParseTuple(args, "ii:GetPage", &tpType, &bPersistChanges)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIPTP->GetPage(tpType, bPersistChanges, &phPage); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIPTP, IID_IProvideTaskPage ); return PyWinLong_FromHANDLE(phPage); } // @object PyIProvideTaskPage|Description of the interface static struct PyMethodDef PyIProvideTaskPage_methods[] = { { "GetPage", PyIProvideTaskPage::GetPage, 1 }, // @pymeth GetPage|Return a property sheet page handle for the spedified type (TASKPAGE_TASK,TASKPAGE_SCHEDULE,TASKPAGE_SETTINGS) { NULL } }; PyComTypeObject PyIProvideTaskPage::type("PyIProvideTaskPage", &PyIUnknown::type, sizeof(PyIProvideTaskPage), PyIProvideTaskPage_methods, GET_PYCOM_CTOR(PyIProvideTaskPage));
PY_INTERFACE_PRECALL; SCODE sc = pMySite->OnScriptTerminate(pVarResult, pExcep); PY_INTERFACE_POSTCALL; if (pVarResult) VariantClear(pVarResult); if (FAILED(sc)) return SetPythonCOMError(self, sc); return PyInt_FromLong(sc); } // @object PyIActiveScriptSite|An object providing the IActiveScriptSite interface static struct PyMethodDef PyIActiveScriptSite_methods[] = { {"GetLCID",PyIActiveScriptSite::GetLCID, 1}, // @pymeth GetLCID| {"GetItemInfo",PyIActiveScriptSite::GetItemInfo, 1}, // @pymeth GetItemInfo| {"GetDocVersionString",PyIActiveScriptSite::GetDocVersionString, 1}, // @pymeth GetDocVersionString| {"OnStateChange",PyIActiveScriptSite::OnStateChange, 1}, // @pymeth OnStateChange| {"OnEnterScript",PyIActiveScriptSite::OnEnterScript, 1}, // @pymeth OnEnterScript| {"OnLeaveScript",PyIActiveScriptSite::OnLeaveScript, 1}, // @pymeth OnLeaveScript| {"OnScriptError",PyIActiveScriptSite::OnScriptError, 1}, // @pymeth OnScriptError| {"OnScriptTerminate",PyIActiveScriptSite::OnScriptTerminate, 1}, // @pymeth OnScriptTerminate| {NULL, NULL} }; PyComTypeObject PyIActiveScriptSite::type("PyIActiveScriptSite", &PyIUnknown::type, sizeof(PyIActiveScriptSite), PyIActiveScriptSite_methods, GET_PYCOM_CTOR(PyIActiveScriptSite));
IContext *pIC = GetI(self); if ( pIC == NULL ) return NULL; IEnumContextProps * pEnumContextProps; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIC->EnumContextProps( &pEnumContextProps ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIC, IID_IContext ); return PyCom_PyObjectFromIUnknown(pEnumContextProps, IID_IEnumContextProps, FALSE); } // @object PyIContext|Allows access to properties defined for the current context (Requires win2k or later) static struct PyMethodDef PyIContext_methods[] = { { "SetProperty", PyIContext::SetProperty, 1 }, // @pymeth SetProperty|Sets a property on the context { "RemoveProperty", PyIContext::RemoveProperty, 1 }, // @pymeth RemoveProperty|Removes a property from the context { "GetProperty", PyIContext::GetProperty, 1 }, // @pymeth GetProperty|Retrieves a context property { "EnumContextProps", PyIContext::EnumContextProps, METH_NOARGS}, // @pymeth EnumContextProps|Returns an enumerator for the context properties { NULL } }; PyComEnumProviderTypeObject PyIContext::type("PyIContext", &PyIUnknown::type, sizeof(PyIContext), PyIContext_methods, GET_PYCOM_CTOR(PyIContext), "EnumContextProps" );
return pyretval; } // @object PyIActiveScriptErrorDebug|Description of the interface static struct PyMethodDef PyIActiveScriptErrorDebug_methods[] = { { "GetDocumentContext", PyIActiveScriptErrorDebug::GetDocumentContext, 1 }, // @pymeth GetDocumentContext|Description of GetDocumentContext { "GetStackFrame", PyIActiveScriptErrorDebug::GetStackFrame, 1 }, // @pymeth GetStackFrame|Description of GetStackFrame { NULL } }; PyComTypeObject PyIActiveScriptErrorDebug::type("PyIActiveScriptErrorDebug", &PyIActiveScriptError::type, sizeof(PyIActiveScriptErrorDebug), PyIActiveScriptErrorDebug_methods, GET_PYCOM_CTOR(PyIActiveScriptErrorDebug)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGActiveScriptErrorDebug::GetExceptionInfo(EXCEPINFO __RPC_FAR *pexcepinfo) {return PyGActiveScriptError::GetExceptionInfo(pexcepinfo);} STDMETHODIMP PyGActiveScriptErrorDebug::GetSourcePosition(DWORD __RPC_FAR *pdwSourceContext, ULONG __RPC_FAR *pulLineNumber, LONG __RPC_FAR *plCharacterPosition) {return PyGActiveScriptError::GetSourcePosition(pdwSourceContext,pulLineNumber,plCharacterPosition);} STDMETHODIMP PyGActiveScriptErrorDebug::GetSourceLineText(BSTR __RPC_FAR *pbstrSourceLine) {return PyGActiveScriptError::GetSourceLineText(pbstrSourceLine);} STDMETHODIMP PyGActiveScriptErrorDebug::GetDocumentContext( /* [out] */ IDebugDocumentContext __RPC_FAR *__RPC_FAR * ppssc) { PY_GATEWAY_METHOD; if (ppssc==NULL) return E_POINTER; PyObject *result; HRESULT hr=InvokeViaPolicy("GetDocumentContext", &result);
// @object PyIEnumMoniker|A Python interface to IEnumMoniker static struct PyMethodDef PyIEnumMoniker_methods[] = { {"Next", PyIEnumMoniker::Next, 1}, // @pymeth Next|Retrieves a specified number of items in the enumeration sequence. {"Skip", PyIEnumMoniker::Skip, 1}, // @pymeth Skip|Skips over the next specified elementes. {"Reset", PyIEnumMoniker::Reset, 1}, // @pymeth Reset|Resets the enumeration sequence to the beginning. {"Clone", PyIEnumMoniker::Clone, 1}, // @pymeth Clone|Creates another enumerator that contains the same enumeration state as the current one. {NULL, NULL} }; PyComEnumTypeObject PyIEnumMoniker::type("PyIEnumMoniker", &PyIUnknown::type, // @base PyIEnumMoniker|PyIUnknown sizeof(PyIEnumMoniker), PyIEnumMoniker_methods, GET_PYCOM_CTOR(PyIEnumMoniker)); ////////////////////////////////////////////////////////////////////////////////////// PyIMoniker::PyIMoniker(IUnknown *pDisp) : PyIPersistStream(pDisp) { ob_type = &type; } PyIMoniker::~PyIMoniker() { } /*static*/ IMoniker *PyIMoniker::GetI(PyObject *self) { return (IMoniker *)PyIPersistStream::GetI(self);
{ IApplicationDestinations *pIAD = GetI(self); if ( pIAD == NULL ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAD->RemoveAllDestinations( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAD, IID_IApplicationDestinations ); Py_INCREF(Py_None); return Py_None; } // @object PyIApplicationDestinations|Allows an application to removed items from its jump lists // @comm Available on Windows 7 and later static struct PyMethodDef PyIApplicationDestinations_methods[] = { { "SetAppID", PyIApplicationDestinations::SetAppID, 1 }, // @pymeth SetAppID|Specifies the application whose jump list is to be accessed { "RemoveDestination", PyIApplicationDestinations::RemoveDestination, 1 }, // @pymeth RemoveDestination|Removes a single entry from the jump list { "RemoveAllDestinations", PyIApplicationDestinations::RemoveAllDestinations, METH_NOARGS }, // @pymeth RemoveAllDestinations|Removes all Recent and Frequent jump list entries { NULL } }; PyComTypeObject PyIApplicationDestinations::type("PyIApplicationDestinations", &PyIUnknown::type, sizeof(PyIApplicationDestinations), PyIApplicationDestinations_methods, GET_PYCOM_CTOR(PyIApplicationDestinations)); #endif // WINVER
return pyretval; } // @object PyIInternetPriority|Description of the interface static struct PyMethodDef PyIInternetPriority_methods[] = { { "SetPriority", PyIInternetPriority::SetPriority, 1 }, // @pymeth SetPriority|Description of SetPriority { "GetPriority", PyIInternetPriority::GetPriority, 1 }, // @pymeth GetPriority|Description of GetPriority { NULL } }; PyComTypeObject PyIInternetPriority::type("PyIInternetPriority", &PyIUnknown::type, sizeof(PyIInternetPriority), PyIInternetPriority_methods, GET_PYCOM_CTOR(PyIInternetPriority)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGInternetPriority::SetPriority( /* [in] */ LONG nPriority) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("SetPriority", NULL, "i", nPriority); return hr; } STDMETHODIMP PyGInternetPriority::GetPriority( /* [out] */ LONG __RPC_FAR * pnPriority) { PY_GATEWAY_METHOD;
// @object PyIShellIconOverlayManager|Description of the interface static struct PyMethodDef PyIShellIconOverlayManager_methods[] = { { "GetFileOverlayInfo", PyIShellIconOverlayManager::GetFileOverlayInfo, 1 }, // @pymeth GetFileOverlayInfo|Description of GetFileOverlayInfo { "GetReservedOverlayInfo", PyIShellIconOverlayManager::GetReservedOverlayInfo, 1 }, // @pymeth GetReservedOverlayInfo|Description of GetReservedOverlayInfo { "RefreshOverlayImages", PyIShellIconOverlayManager::RefreshOverlayImages, 1 }, // @pymeth RefreshOverlayImages|Description of RefreshOverlayImages { "LoadNonloadedOverlayIdentifiers", PyIShellIconOverlayManager::LoadNonloadedOverlayIdentifiers, 1 }, // @pymeth LoadNonloadedOverlayIdentifiers|Description of LoadNonloadedOverlayIdentifiers { "OverlayIndexFromImageIndex", PyIShellIconOverlayManager::OverlayIndexFromImageIndex, 1 }, // @pymeth OverlayIndexFromImageIndex|Description of OverlayIndexFromImageIndex { NULL } }; PyComTypeObject PyIShellIconOverlayManager::type("PyIShellIconOverlayManager", &PyIUnknown::type, sizeof(PyIShellIconOverlayManager), PyIShellIconOverlayManager_methods, GET_PYCOM_CTOR(PyIShellIconOverlayManager)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGShellIconOverlayManager::GetFileOverlayInfo( /* [unique][in] */ LPCWSTR path, /* [unique][in] */ DWORD attrib, /* [out] */ int __RPC_FAR * index, /* [in] */ DWORD flags) { PY_GATEWAY_METHOD; PyObject *obpath; obpath = MakeOLECHARToObj(path); PyObject *result; HRESULT hr=InvokeViaPolicy("GetFileOverlayInfo", &result, "Oll", obpath, attrib, flags); Py_XDECREF(obpath);
// @object PyIShellItem|Interface that represents an item in the Explorer shell static struct PyMethodDef PyIShellItem_methods[] = { { "BindToHandler", PyIShellItem::BindToHandler, 1 }, // @pymeth BindToHandler|Creates an instance of one of the item's handlers { "GetParent", PyIShellItem::GetParent, 1 }, // @pymeth GetParent|Retrieves the parent of this item { "GetDisplayName", PyIShellItem::GetDisplayName, 1 }, // @pymeth GetDisplayName|Returns the display name of the item in the specified format { "GetAttributes", PyIShellItem::GetAttributes, 1 }, // @pymeth GetAttributes|Returns shell attributes of the item { "Compare", PyIShellItem::Compare, 1 }, // @pymeth Compare|Compares another shell item with this item { NULL } }; PyComTypeObject PyIShellItem::type("PyIShellItem", &PyIUnknown::type, sizeof(PyIShellItem), PyIShellItem_methods, GET_PYCOM_CTOR(PyIShellItem)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGShellItem::BindToHandler( /* [unique][in] */ IBindCtx * pbc, /* [in] */ REFGUID bhid, /* [in] */ REFIID riid, /* [iid_is][out] */ void ** ppv) { PY_GATEWAY_METHOD; PyObject *obpbc; PyObject *obbhid; PyObject *obriid; obpbc = PyCom_PyObjectFromIUnknown(pbc, IID_IBindCtx, TRUE); obbhid = PyWinObject_FromIID(bhid);
} // @object PyITaskTrigger|Python object that encapsulates the ITaskTrigger interface static struct PyMethodDef PyITaskTrigger_methods[] = { { "SetTrigger", PyITaskTrigger::SetTrigger, 1 }, // @pymeth SetTrigger|Set trigger parameters from a PyTASK_TRIGGER object { "GetTrigger", PyITaskTrigger::GetTrigger, 1 }, // @pymeth GetTrigger|Retrieves trigger parms as a PyTASK_TRIGGER object { "GetTriggerString", PyITaskTrigger::GetTriggerString, 1 }, // @pymeth GetTriggerString|Build text summary of trigger { NULL } }; PyComTypeObject PyITaskTrigger::type("PyITaskTrigger", &PyIUnknown::type, sizeof(PyITaskTrigger), PyITaskTrigger_methods, GET_PYCOM_CTOR(PyITaskTrigger)); static struct PyMethodDef PyTASK_TRIGGER_methods[] = { { NULL } }; #define OFF(e) offsetof(PyTASK_TRIGGER, e) static struct PyMemberDef PyTASK_TRIGGER_members[] = { {"Reserved1", T_USHORT, OFF(task_trigger.Reserved1), 0, "Reserved, do not use"}, {"Reserved2", T_USHORT, OFF(task_trigger.Reserved2), 0, "Reserved, do not use"}, {"BeginYear", T_USHORT, OFF(task_trigger.wBeginYear), 0, NULL}, {"BeginMonth", T_USHORT, OFF(task_trigger.wBeginMonth), 0, NULL}, {"BeginDay", T_USHORT, OFF(task_trigger.wBeginDay), 0, NULL}, {"EndYear", T_USHORT, OFF(task_trigger.wEndYear), 0, NULL}, {"EndMonth", T_USHORT, OFF(task_trigger.wEndMonth), 0, NULL},
{ "SetHotkey", PyIShellLink::SetHotkey, 1 }, // @pymeth SetHotkey|Sets the hot key for a shell link object. { "GetShowCmd", PyIShellLink::GetShowCmd, 1 }, // @pymeth GetShowCmd|Retrieves the show (SW_) command for a shell link object. { "SetShowCmd", PyIShellLink::SetShowCmd, 1 }, // @pymeth SetShowCmd|Sets the show (SW_) command for a shell link object. { "GetIconLocation", PyIShellLink::GetIconLocation, 1 }, // @pymeth GetIconLocation|Retrieves the location (path and index) of the icon for a shell link object. { "SetIconLocation", PyIShellLink::SetIconLocation, 1 }, // @pymeth SetIconLocation|Sets the location (path and index) of the icon for a shell link object. { "SetRelativePath", PyIShellLink::SetRelativePath, 1 }, // @pymeth SetRelativePath|Sets the relative path for a shell link object. { "Resolve", PyIShellLink::Resolve, 1 }, // @pymeth Resolve|Resolves a shell link { "SetPath", PyIShellLink::SetPath, 1 }, // @pymeth SetPath|Sets the path and file name of a shell link object. { NULL } }; PyComTypeObject PyIShellLink::type("PyIShellLink", &PyIUnknown::type, sizeof(PyIShellLink), PyIShellLink_methods, GET_PYCOM_CTOR(PyIShellLink)); // --------------------------------------------------- // // Gateway Implementation // Python never needs to implement this!!! /********************************** STDMETHODIMP PyGShellLink::GetPath( LPSTR pszFile, int cchMaxPath, WIN32_FIND_DATAA * pfd, DWORD fFlags) { PY_GATEWAY_METHOD; // *** The input argument pszFile of type "LPSTR" was not processed *** // - Please ensure this conversion function exists, and is appropriate // - The type 'LPSTR' (pszFile) is unknown.
return PyLong_FromLong(hr); } // @object PyICancelMethodCalls|Interface to request cancellation of a call. See <om pythoncom.CoGetCancelObject>. static struct PyMethodDef PyICancelMethodCalls_methods[] = { { "Cancel", PyICancelMethodCalls::Cancel, 1 }, // @pymeth Cancel|Cancels a pending call { "TestCancel", PyICancelMethodCalls::TestCancel, METH_NOARGS}, // @pymeth TestCancel|Checks if a request has been made to cancel a call { NULL } }; PyComTypeObject PyICancelMethodCalls::type("PyICancelMethodCalls", &PyIUnknown::type, sizeof(PyICancelMethodCalls), PyICancelMethodCalls_methods, GET_PYCOM_CTOR(PyICancelMethodCalls)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGCancelMethodCalls::Cancel( /* [in] */ ULONG ulSeconds) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("Cancel", NULL, "l", ulSeconds); return hr; } STDMETHODIMP PyGCancelMethodCalls::TestCancel( void) { PY_GATEWAY_METHOD;
IEnumBackgroundCopyJobs *pIEnumBackgroundCopyJobs = GetI(self); if ( pIEnumBackgroundCopyJobs == NULL ) return NULL; IEnumBackgroundCopyJobs *pClone; PY_INTERFACE_PRECALL; HRESULT hr = pIEnumBackgroundCopyJobs->Clone(&pClone); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEnumBackgroundCopyJobs, IID_IEnumBackgroundCopyJobs); return PyCom_PyObjectFromIUnknown(pClone, IID_IEnumBackgroundCopyJobs, FALSE); } // @object PyIEnumBackgroundCopyJobs|A Python interface to IEnumBackgroundCopyJobs static struct PyMethodDef PyIEnumBackgroundCopyJobs_methods[] = { { "Next", PyIEnumBackgroundCopyJobs::Next, 1 }, // @pymeth Next|Retrieves a specified number of items in the enumeration sequence. { "Skip", PyIEnumBackgroundCopyJobs::Skip, 1 }, // @pymeth Skip|Skips over the next specified elementes. { "Reset", PyIEnumBackgroundCopyJobs::Reset, 1 }, // @pymeth Reset|Resets the enumeration sequence to the beginning. { "Clone", PyIEnumBackgroundCopyJobs::Clone, 1 }, // @pymeth Clone|Creates another enumerator that contains the same enumeration state as the current one. { NULL } }; PyComEnumTypeObject PyIEnumBackgroundCopyJobs::type("PyIEnumBackgroundCopyJobs", &PyIUnknown::type, sizeof(PyIEnumBackgroundCopyJobs), PyIEnumBackgroundCopyJobs_methods, GET_PYCOM_CTOR(PyIEnumBackgroundCopyJobs));
{ if ( !PyArg_ParseTuple(args, ":InitNew") ) return NULL; IPersistStreamInit *pIPSI = GetI(self); if ( pIPSI == NULL ) return NULL; PY_INTERFACE_PRECALL; HRESULT hr = pIPSI->InitNew(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIPSI, IID_IPersistStreamInit); Py_INCREF(Py_None); return Py_None; } // @object PyIPersistStreamInit|A Python interface to IPersistStreamInit static struct PyMethodDef PyIPersistStreamInit_methods[] = { {"InitNew", PyIPersistStreamInit::InitNew, 1}, // @pymeth InitNew|Initializes the object to a default state. {NULL, NULL} }; PyComTypeObject PyIPersistStreamInit::type("PyIPersistStreamInit", &PyIPersistStream::type, // @base PyIPersistStreamInit|PyIPersistStream sizeof(PyIPersistStreamInit), PyIPersistStreamInit_methods, GET_PYCOM_CTOR(PyIPersistStreamInit));
// @object PyIActiveScriptSiteDebug|Description of the interface static struct PyMethodDef PyIActiveScriptSiteDebug_methods[] = { { "GetDocumentContextFromPosition", PyIActiveScriptSiteDebug::GetDocumentContextFromPosition, 1 }, // @pymeth GetDocumentContextFromPosition|Description of GetDocumentContextFromPosition { "GetApplication", PyIActiveScriptSiteDebug::GetApplication, 1 }, // @pymeth GetApplication|Description of GetApplication { "GetRootApplicationNode", PyIActiveScriptSiteDebug::GetRootApplicationNode, 1 }, // @pymeth GetRootApplicationNode|Description of GetRootApplicationNode { "OnScriptErrorDebug", PyIActiveScriptSiteDebug::OnScriptErrorDebug, 1 }, // @pymeth OnScriptErrorDebug|Allows a smart host to control the handling of runtime errors { NULL } }; PyComTypeObject PyIActiveScriptSiteDebug::type("PyIActiveScriptSiteDebug", &PyIUnknown::type, sizeof(PyIActiveScriptSiteDebug), PyIActiveScriptSiteDebug_methods, GET_PYCOM_CTOR(PyIActiveScriptSiteDebug)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGActiveScriptSiteDebug::GetDocumentContextFromPosition( #ifdef _WIN64 /* [in] */ DWORDLONG dwSourceContext, #else /* [in] */ DWORD dwSourceContext, #endif /* [in] */ ULONG uCharacterOffset, /* [in] */ ULONG uNumChars, /* [out] */ IDebugDocumentContext __RPC_FAR *__RPC_FAR * ppsc) { PY_GATEWAY_METHOD;
HRESULT hr; PY_INTERFACE_PRECALL; hr = pIDS->SetSpeakerConfig(config); PY_INTERFACE_POSTCALL; if (FAILED(hr)) { PyWin_SetAPIError("SetSpeakerConfig", hr); return NULL; } Py_INCREF(Py_None); return Py_None; } // @object PyIDirectSound|Description of the interface static struct PyMethodDef PyIDirectSound_methods[] = { { "Initialize", PyIDirectSound::Initialize, 1 }, // @pymeth Initialize|Description of Initialize. { "SetCooperativeLevel", PyIDirectSound::SetCooperativeLevel, 1 }, // @pymeth SetCooperativeLevel|Description of SetCooperativeLevel. { "CreateSoundBuffer", PyIDirectSound::CreateSoundBuffer, 1 }, // @pymeth CreateSoundBuffer|Description of CreateSoundBuffer. { "GetCaps", PyIDirectSound::GetCaps, 1 }, // @pymeth GetCaps|Description of GetCaps. { "Compact", PyIDirectSound::Compact, 1 }, // @pymeth Compact|Description of Compact. { NULL } }; PyComTypeObject PyIDirectSound::type("PyIDirectSound", &PyIUnknown::type, sizeof(PyIDirectSound), PyIDirectSound_methods, GET_PYCOM_CTOR(PyIDirectSound));
} // @object PyIDebugDocumentInfo|Provides information on a document, which may or may not be instantiated. static struct PyMethodDef PyIDebugDocumentInfo_methods[] = { { "GetName", PyIDebugDocumentInfo::GetName, 1 }, // @pymeth GetName|Returns the specified name for the document. { "GetDocumentClassId", PyIDebugDocumentInfo::GetDocumentClassId, 1 }, // @pymeth GetDocumentClassId|Returns a CLSID describing the document type. { NULL } }; PyComTypeObject PyIDebugDocumentInfo::type("PyIDebugDocumentInfo", &PyIUnknown::type, sizeof(PyIDebugDocumentInfo), PyIDebugDocumentInfo_methods, GET_PYCOM_CTOR(PyIDebugDocumentInfo)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGDebugDocumentInfo::GetName( /* [in] */ DOCUMENTNAMETYPE dnt, /* [out] */ BSTR __RPC_FAR * pbstrName) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetName", &result, "i", dnt); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obpbstrName;
{ "UIActivate", PyIShellView::UIActivate, 1 }, // @pymeth UIActivate|Description of UIActivate { "Refresh", PyIShellView::Refresh, 1 }, // @pymeth Refresh|Description of Refresh { "CreateViewWindow", PyIShellView::CreateViewWindow, 1 }, // @pymeth CreateViewWindow|Description of CreateViewWindow { "DestroyViewWindow", PyIShellView::DestroyViewWindow, 1 }, // @pymeth DestroyViewWindow|Description of DestroyViewWindow { "GetCurrentInfo", PyIShellView::GetCurrentInfo, 1 }, // @pymeth GetCurrentInfo|Description of GetCurrentInfo { "SaveViewState", PyIShellView::SaveViewState, 1 }, // @pymeth SaveViewState|Description of SaveViewState { "SelectItem", PyIShellView::SelectItem, 1 }, // @pymeth SelectItem|Description of SelectItem { "GetItemObject", PyIShellView::GetItemObject, 1 }, // @pymeth GetItemObject|Description of GetItemObject { NULL } }; PyComTypeObject PyIShellView::type("PyIShellView", &PyIOleWindow::type, sizeof(PyIShellView), PyIShellView_methods, GET_PYCOM_CTOR(PyIShellView)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGShellView::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGShellView::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} STDMETHODIMP PyGShellView::TranslateAccelerator( /* [in] */ MSG * pmsg) { PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); if (obpmsg==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("TranslateAccelerator"); PyObject *result; HRESULT hr=InvokeViaPolicy("TranslateAccelerator", &result, "(O)", obpmsg);