本文整理汇总了C++中IOleObject::SetHostNames方法的典型用法代码示例。如果您正苦于以下问题:C++ IOleObject::SetHostNames方法的具体用法?C++ IOleObject::SetHostNames怎么用?C++ IOleObject::SetHostNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOleObject
的用法示例。
在下文中一共展示了IOleObject::SetHostNames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BBString
Win32HtmlViewRep( Win32HtmlView *view, HWND hw,int style ):hwnd(hw){
owner=view;
site.rep=this;
eventsink.rep=this;
frame.rep=this;
viewstyle=style;
emitNavEvent=!!(viewstyle & BBHtmlView::NONAVIGATE);
currenturl=new BBString("");
eventurl=new BBString("");
OleCreate( CLSID_WebBrowser,IID_IOleObject,OLERENDER_DRAW,0,&site,&storage,(void**)&oleObject );
OleSetContainedObject( oleObject,TRUE);
oleObject->SetHostNames(L"Web Host",L"Web View");
oleObject->QueryInterface(IID_IWebBrowser2,(void**)&iBrowser);
oleObject->QueryInterface(IID_IOleInPlaceObject,(void**)&inPlaceObject );
oleObject->QueryInterface(IID_IConnectionPointContainer,(void**)&iConnection);
iConnection->FindConnectionPoint(DIID_DWebBrowserEvents, &iConnectionPoint);
iConnectionPoint->Advise((LPUNKNOWN)&eventsink, &dwCookie);
RECT rect;
::GetClientRect( hwnd,&rect );
oleObject->DoVerb(OLEIVERB_SHOW,NULL,&site,-1,hwnd,&rect);
go( "about:blank" );
}
示例2: OleSetOleError
// @pymethod |PyIOleObject|SetHostNames|Description of SetHostNames.
PyObject *PyIOleObject::SetHostNames(PyObject *self, PyObject *args)
{
IOleObject *pIOO = GetI(self);
if ( pIOO == NULL )
return NULL;
// @pyparm <o unicode>|szContainerApp||Description for szContainerApp
// @pyparm <o unicode>|szContainerObj||Description for szContainerObj
PyObject *obszContainerApp;
PyObject *obszContainerObj;
LPOLESTR szContainerApp;
LPOLESTR szContainerObj;
if ( !PyArg_ParseTuple(args, "OO:SetHostNames", &obszContainerApp, &obszContainerObj) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (!PyCom_BstrFromPyObject(obszContainerApp, &szContainerApp)) bPythonIsHappy = FALSE;
if (!PyCom_BstrFromPyObject(obszContainerObj, &szContainerObj)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIOO->SetHostNames( szContainerApp, szContainerObj );
PY_INTERFACE_POSTCALL;
SysFreeString(szContainerApp);
SysFreeString(szContainerObj);
if ( FAILED(hr) )
return OleSetOleError(hr);
Py_INCREF(Py_None);
return Py_None;
}