1

Topic: MFC dialog + IOleObject-> SetClientSite

Greetings to all. Is available MFC dialog based application with allocated on dialogue WebBrowser th. For WebBrowser-a there was a task of substitution of a proxy with authorization. Separate class CClientClass in which interfaces IOleClientSite, IAuthenticate, IServiceProvider are implemented is for this purpose added. Further this class is transferred in method SetClientSite for object IOleObject received of WebBrowser. Process of authorization happens correctly, method Authenticate in class CClientClass is caused, and further there is a passage to pages in WebBrowser already through a proxy. But there was a ghost effect of such implementation, it appeared that the element WebBrowser ceased to process pushings of keys, i.e. any text enterings in fields became already impossible. Someone can prompt where that incorrectly, I suspect that CClientClass it is necessary to add something still probably. Transmission CClientClass if (LPUNKNOWN pUnk = m_Browser. GetControlUnknown ()) {if (SUCCEEDED (pUnk-> QueryInterface (IID_IWebBrowser2, (void **) &piWebBrowser2))) {hr = piWebBrowser2-> QueryInterface (IID_IOleObject, (void **) &pOleObject);}} if (pOleObject) {hr = pOleObject-> SetClientSite ((IOleClientSite *) &m_client);}  CClientClass #include "mshtmhst.h" class CClientClass: public IOleClientSite, IAuthenticate, IServiceProvider {public: CClientClass (void) {} ~CClientClass (void) {}//IUnknown STDMETHODIMP _ (ULONG) AddRef (); STDMETHODIMP _ (ULONG) Release (); STDMETHODIMP QueryInterface (REFIID riid, void ** ppv);//IOleClientSite STDMETHODIMP SaveObject (void) {return E_NOTIMPL;} STDMETHODIMP GetMoniker (/* [in] */DWORD dwAssign,/* [in] */DWORD dwWhichMoniker,/* [out] */IMoniker ** ppmk) {return E_NOTIMPL;} STDMETHODIMP GetContainer (/* [out] */IOleContainer ** ppContainer) {return E_NOTIMPL;} STDMETHODIMP ShowObject (void) {MessageBox (NULL, "ShowObject", "container", MB_OK); return S_OK;} STDMETHODIMP OnShowWindow (/* [in] */BOOL fShow) {return S_OK;} STDMETHODIMP RequestNewObjectLayout (void) {return E_NOTIMPL;}//IServiceProvider STDMETHODIMP QueryService (REFGUID guid, REFIID iid, LPVOID * ppv);//IAuthenticate STDMETHODIMP Authenticate (HWND __ RPC_FAR *phwnd, LPWSTR __ RPC_FAR *pszUsername, LPWSTR __ RPC_FAR *pszPassword);}; I Thank for the help.

2

Re: MFC dialog + IOleObject-> SetClientSite

Hello, loggik, you wrote: L> Greetings to all. L> but there was a ghost effect of such implementation, it appeared that the element WebBrowser ceased to process pushings of keys, i.e. any text enterings in fields became already impossible. L> someone can prompt where that incorrectly, I suspect that CClientClass it is necessary to add something still probably. L> I thank for the help. Well and method IAuthenticate:: Authenticate is caused or not?

3

Re: MFC dialog + IOleObject-> SetClientSite

Hello, Carc, you wrote: a C> Hello, loggik, you wrote: L>> Greetings to all. L>> but there was a ghost effect of such implementation, it appeared that the element WebBrowser ceased to process pushings of keys, i.e. any text enterings in fields became already impossible. L>> someone can prompt where that incorrectly, I suspect that CClientClass it is necessary to add something still probably. L>> I thank for the help. The C> Well and method IAuthenticate:: Authenticate is caused or not? With it everything is all right. Method Authenticate is caused, and in it transmission login/pass is implemented, and further there is an authorization on a proxy the server. I.e. WebBrowser implementation CClientClass incomplete since a part of functions most WebBrowser do not work comes on pages already through a proxy, but most likely. In CClientClass requests about additional interfaces, in particular IOleInPlaceSite come, it too needs to be implemented.