- Home
- Producten
- Bedrijfsbehoeften
- Partners
- Referenties
- Kenniscentrum
- Support
- Over Perrit
- Handleidingen
- Nieuws
- Acties
Datum Tijd Versie Grootte Bestandsnaam --------------------------------------------------------- 19-nov-2002 23:22:38 6.0.2800.1139 483.328 Urlmon.dll
#include <afxocc.h>#include <afxhtml.h>
class CHtmlControlSite: public COleControlSite{public: CHtmlControlSite(COleControlContainer* pParentWnd); ~CHtmlControlSite();
CHtmlView* GetView() const;
BEGIN_INTERFACE_PART(DocHostUIHandler, IDocHostUIHandler) STDMETHOD(ShowContextMenu)(DWORD, LPPOINT, LPUNKNOWN, LPDISPATCH); STDMETHOD(GetHostInfo)(DOCHOSTUIINFO*); STDMETHOD(ShowUI)(DWORD, LPOLEINPLACEACTIVEOBJECT, LPOLECOMMANDTARGET, LPOLEINPLACEFRAME, LPOLEINPLACEUIWINDOW); STDMETHOD(HideUI)(void); STDMETHOD(UpdateUI)(void); STDMETHOD(EnableModeless)(BOOL); STDMETHOD(OnDocWindowActivate)(BOOL); STDMETHOD(OnFrameWindowActivate)(BOOL); STDMETHOD(ResizeBorder)(LPCRECT, LPOLEINPLACEUIWINDOW, BOOL); STDMETHOD(TranslateAccelerator)(LPMSG, const GUID*, DWORD); STDMETHOD(GetOptionKeyPath)(OLECHAR **, DWORD); STDMETHOD(GetDropTarget)(LPDROPTARGET, LPDROPTARGET*); STDMETHOD(GetExternal)(LPDISPATCH*); STDMETHOD(TranslateUrl)(DWORD, OLECHAR*, OLECHAR **); STDMETHOD(FilterDataObject)(LPDATAOBJECT , LPDATAOBJECT*); END_INTERFACE_PART(DocHostUIHandler)
DECLARE_INTERFACE_MAP()};
class CMyOleControlSite: public CHtmlControlSite{public: CMyOleControlSite(COleControlContainer *pCnt = NULL):CHtmlControlSite(pCnt) {}
BEGIN_INTERFACE_PART(Authenticate, IAuthenticate)
STDMETHODIMP Authenticate( HWND __RPC_FAR *phwnd, LPWSTR __RPC_FAR *pszUsername, LPWSTR __RPC_FAR *pszPassword);
END_INTERFACE_PART(Authenticate)
BEGIN_INTERFACE_PART(ServiceProvider, IServiceProvider) STDMETHODIMP QueryService(REFGUID guid, REFIID iid, LPVOID * ppv); END_INTERFACE_PART(ServiceProvider)
DECLARE_INTERFACE_MAP();};
#include "stdafx.h"#include "MyOleControlSite.h"
BEGIN_INTERFACE_MAP(CMyOleControlSite, CHtmlControlSite) INTERFACE_PART(CMyOleControlSite, IID_IAuthenticate, Authenticate) INTERFACE_PART(CMyOleControlSite, IID_IServiceProvider, ServiceProvider)END_INTERFACE_MAP()
///////////////////////////////////////////////////////////////////////////// // CMyOleControlSite: IAthenticate::IUnknown methods
ULONG CMyOleControlSite::XAuthenticate::AddRef(){ METHOD_PROLOGUE(CMyOleControlSite, Authenticate) return pThis->ExternalAddRef();}
ULONG CMyOleControlSite::XAuthenticate::Release(){ METHOD_PROLOGUE(CMyOleControlSite, Authenticate) return pThis->ExternalRelease();}
HRESULT CMyOleControlSite::XAuthenticate::QueryInterface(REFIID riid, void **ppvObj){ METHOD_PROLOGUE(CMyOleControlSite, Authenticate) HRESULT hr = (HRESULT)pThis->ExternalQueryInterface(&riid, ppvObj); return hr;}
///////////////////////////////////////////////////////////////////////////// // CMyOleControlSite: Verificatiemethoden
STDMETHODIMP CMyOleControlSite::XAuthenticate::Authenticate( HWND __RPC_FAR *phwnd, LPWSTR __RPC_FAR *pszUsername, LPWSTR __RPC_FAR *pszPassword){ METHOD_PROLOGUE(CMyOleControlSite, Authenticate)
// voeg code uit de volgende stap toe
return S_OK;}
// // IServiceProvider//
ULONG CMyOleControlSite::XServiceProvider::AddRef(){ METHOD_PROLOGUE(CMyOleControlSite, ServiceProvider) return pThis->ExternalAddRef();}
ULONG CMyOleControlSite::XServiceProvider::Release(){ METHOD_PROLOGUE(CMyOleControlSite, ServiceProvider) return pThis->ExternalRelease();}
HRESULT CMyOleControlSite::XServiceProvider::QueryInterface(REFIID riid, void **ppvObj){ METHOD_PROLOGUE(CMyOleControlSite, ServiceProvider) HRESULT hr = (HRESULT)pThis->ExternalQueryInterface(&riid, ppvObj); return hr;}
STDMETHODIMP CMyOleControlSite::XServiceProvider::QueryService(REFGUID sid, REFIID iid, LPVOID * ppv){ METHOD_PROLOGUE(CMyOleControlSite, ServiceProvider)
if (sid == IID_IAuthenticate || iid == IID_IAuthenticate) { return (HRESULT)pThis->ExternalQueryInterface(&iid, ppv); } else { *ppv = NULL; } return E_NOINTERFACE;}
class CProxyTestView: public CHtmlView{... BOOL CreateControlSite(COleControlContainer* pContainer, COleControlSite** ppSite, UINT nID, REFCLSID clsid);
BOOL CProxyTestView::CreateControlSite(COleControlContainer* pContainer, COleControlSite** ppSite, UINT nID, REFCLSID clsid){ ASSERT(ppSite != NULL); *ppSite = new CMyOleControlSite(pContainer); return TRUE;}
STDMETHODIMP CMyOleControlSite::XAuthenticate::Authenticate( HWND __RPC_FAR *phwnd, LPWSTR __RPC_FAR *pszUsername, LPWSTR __RPC_FAR *pszPassword){ METHOD_PROLOGUE(CMyOleControlSite, Authenticate)
CString strUsername = "Altoid/LocalAltoid"; CString strPassword = "Test123"; WCHAR *wszDlgUser = (WCHAR *) CoTaskMemAlloc(255 * sizeof(WCHAR)); WCHAR *wszDlgPassword = (WCHAR *) CoTaskMemAlloc(255 * sizeof(WCHAR)); MultiByteToWideChar(GetACP(), 0, (const char*)strUsername, -1, wszDlgUser, 255); MultiByteToWideChar(GetACP(), 0, (const char*)strPassword, -1, wszDlgPassword, 255); *pszUsername = wszDlgUser; *pszPassword = wszDlgPassword; *phwnd = NULL;
return S_OK;}
void CProxyTestView::OnInitialUpdate(){ CHtmlView::OnInitialUpdate(); Navigate2(_T("about:blank"),NULL,NULL);}
void CProxyTestView::OnActionTest(){ Navigate2(_T("https://www.etrade.com"),NULL,NULL);}
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/vcrefCOleControlSite.asp
Relevante artikelen |
Gekoppelde tagsCache, DLL, Filter, Fix, Foutbericht, Internet Explorer, Internet Explorer 6, MSN, Patch, Project, Query, Service Pack, Tabel, Update, Wachtwoord, Works |