本文整理汇总了C++中IOleInPlaceActiveObject::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IOleInPlaceActiveObject::Release方法的具体用法?C++ IOleInPlaceActiveObject::Release怎么用?C++ IOleInPlaceActiveObject::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOleInPlaceActiveObject
的用法示例。
在下文中一共展示了IOleInPlaceActiveObject::Release方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TranslateAccelerator
LRESULT CWebBrowserUI::TranslateAccelerator( MSG *pMsg )
{
if(pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST)
return S_FALSE;
if( m_pWebBrowser2 == NULL )
return E_NOTIMPL;
// 当前Web窗口不是焦点,不处理加速键
BOOL bIsChild = FALSE;
HWND hTempWnd = NULL;
HWND hWndFocus = ::GetFocus();
hTempWnd = hWndFocus;
while(hTempWnd != NULL)
{
if(hTempWnd == m_hwndHost)
{
bIsChild = TRUE;
break;
}
hTempWnd = ::GetParent(hTempWnd);
}
if(!bIsChild)
return S_FALSE;
IOleInPlaceActiveObject *pObj;
if (FAILED(m_pWebBrowser2->QueryInterface(IID_IOleInPlaceActiveObject, (LPVOID *)&pObj)))
return S_FALSE;
HRESULT hResult = pObj->TranslateAccelerator(pMsg);
pObj->Release();
return hResult;
}
示例2: STDMETHOD
STDMETHOD(SetActiveObject)(IOleInPlaceActiveObject* pActiveObject, LPCOLESTR /*pszObjName*/)
{
if( pActiveObject != NULL ) pActiveObject->AddRef();
if( m_pActiveObject != NULL ) m_pActiveObject->Release();
m_pActiveObject = pActiveObject;
return S_OK;
}
示例3: translateAccelerator
void IEView::translateAccelerator(UINT uMsg, WPARAM wParam, LPARAM lParam) {
IOleInPlaceActiveObject* pIOIPAO;
if (SUCCEEDED(pWebBrowser->QueryInterface(IID_IOleInPlaceActiveObject, (void**)&pIOIPAO))) {
MSG msg;
msg.message = uMsg;
msg.wParam = wParam;
msg.lParam = lParam;
pIOIPAO->TranslateAccelerator(&msg);
pIOIPAO->Release();
}
}
示例4: OnTranslateAccelerator
HRESULT AxContainer::OnTranslateAccelerator( MSG &msg )
{
if (m_pOleObject == NULL)
return S_FALSE;
IOleInPlaceActiveObject *pObj;
if (FAILED(m_pOleObject->QueryInterface(IID_IOleInPlaceActiveObject, (LPVOID *)&pObj)))
return S_FALSE;
HRESULT hResult = pObj->TranslateAccelerator(&msg);
pObj->Release();
return hResult;
}
示例5: PyCom_BuildPyException
// @pymethod |PyIDocHostUIHandler|ShowUI|Description of ShowUI.
PyObject *PyIDocHostUIHandler::ShowUI(PyObject *self, PyObject *args)
{
IDocHostUIHandler *pIDHUIH = GetI(self);
if ( pIDHUIH == NULL )
return NULL;
// @pyparm int|dwID||Description for dwID
// @pyparm <o PyIOleInPlaceActiveObject>|pActiveObject||Description for pActiveObject
// @pyparm <o PyIOleCommandTarget>|pCommandTarget||Description for pCommandTarget
// @pyparm <o PyIOleInPlaceFrame>|pFrame||Description for pFrame
// @pyparm <o PyIOleInPlaceUIWindow>|pDoc||Description for pDoc
PyObject *obpActiveObject;
PyObject *obpCommandTarget;
PyObject *obpFrame;
PyObject *obpDoc;
DWORD dwID;
if ( !PyArg_ParseTuple(args, "lOOOO:ShowUI", &dwID, &obpActiveObject, &obpCommandTarget, &obpFrame, &obpDoc) )
return NULL;
IOleInPlaceActiveObject * pActiveObject;
IOleCommandTarget * pCommandTarget;
IOleInPlaceFrame * pFrame;
IOleInPlaceUIWindow * pDoc;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpActiveObject, IID_IOleInPlaceActiveObject, (void **)&pActiveObject, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpCommandTarget, IID_IOleCommandTarget, (void **)&pCommandTarget, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpFrame, IID_IOleInPlaceFrame, (void **)&pFrame, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpDoc, IID_IOleInPlaceUIWindow, (void **)&pDoc, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDHUIH->ShowUI( dwID, pActiveObject, pCommandTarget, pFrame, pDoc );
if (pActiveObject) pActiveObject->Release();
if (pCommandTarget) pCommandTarget->Release();
if (pFrame) pFrame->Release();
if (pDoc) pDoc->Release();
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIDHUIH, IID_IDocHostUIHandler );
return PyInt_FromLong(hr);
}