Article View: borland.public.cppbuilder.internet.web
Article #1305I successed to get pOleObject and set pmyIOleClientSite.. how
From: jini
Date: Thu, 10 Mar 2005 04:08
Date: Thu, 10 Mar 2005 04:08
67 lines
2975 bytes
2975 bytes
I successed to get pOleObject and set pmyIOleClientSite..
but i don't know how use pmyIDocHostShowUI, pmyIDocHostUIHandlerr.. etc.
i coded like below...
//--------------------------------------------------------------------------
-
class myIOleClientSite :public IOleClientSite
{
...
};
class myIDocHostShowUI :public IDocHostShowUI
{
...
}
class myIDocHostUIHandler :public IDocHostUIHandler
{
...
}
pmyIOleClientSite = new myIOleClientSite;
pmyIDocHostUIHandler = new myIDocHostUIHandler;
pmyIDocHostShowUI = new myIDocHostShowUI;
IServiceProvider *pServiceProvider = NULL;
if (
SUCCEEDED(Web->Document->QueryInterface(IID_IServiceProvider,(LPVOID*)&pServ
iceProvider)) )
{
IWebBrowser2 *pWebBrowser = NULL;
if ( SUCCEEDED(pServiceProvider->QueryService(IID_IWebBrowserApp,
IID_IWebBrowser2, (LPVOID*)&pWebBrowser)) )
{
IOleObject *pOleObject = NULL;
if (
SUCCEEDED(pWebBrowser->QueryInterface(IID_IOleObject,(LPVOID*)&pOleObject))
)
{
pOleObject->SetClientSite(pmyIOleClientSite); // <---
SUCCESS..!!
//
// ????????????????????????????????????????????????
// how to use pmyIDocHostShowUI,
// pmyIDocHostUIHandlerr etc.. that implemented by me
// ????????????????????????????????????????????????
//
}
pWebBrowser->Release();
}
pServiceProvider->Release();
}
//--------------------------------------------------------------------------
-
i know how to use myIDocHostUIHandler by ICustomDoc.
ICustomDoc *pCustomDoc;
Web->Document->QueryInterface(&pCustomDoc);
if (pCustomDoc) pCustomDoc->SetUIHandler(pmyIDocHostUIHandler);
but this solution cannot use myIDocHostShowUI.
and you said to me "Using IOleObject and IOleClientSite is more flexible
than using ICustomDoc, though."
so i want use IOleClientSite..
please help me!!
Thanks...
Technical Details
Message-ID:
<422fc828$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<422d9caa@newsgroups.borland.com> <422de978@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,2e915bcaf988658 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "jini" <fseconds@hotmail.com> From: "jini" <fseconds@hotmail.com> Newsgroups: borland.public.cppbuilder.internet.web References: <422d9caa@newsgroups.borland.com> <422de978@newsgroups.borland.com> Subject: I successed to get pOleObject and set pmyIOleClientSite.. how Date: Thu, 10 Mar 2005 13:08:57 +0900 Lines: 71 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 218.51.152.106 Message-ID: <422fc828$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1110427688 218.51.152.106 (9 Mar 2005 20:08:08 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail