#include "stdafx.h"
#if _MFC_VER >= 0x0700
#include <afxocc.h>
#else
#ifdef _AFXDLL
#undef AFX_DATA
#define AFX_DATA AFX_DATA_IMPORT
#endif
#include <..\src\occimpl.h>
#ifdef _AFXDLL
#undef AFX_DATA
#define AFX_DATA AFX_DATA_EXPORT
#endif
#endif
#include <mshtmhst.h>
#include "DocHostSite.h"
#include "MyHtmlView.h"
BEGIN_INTERFACE_MAP(CDocHostSite, COleControlSite)
INTERFACE_PART(CDocHostSite, IID_IDocHostShowUI, DocHostShowUI)
INTERFACE_PART(CDocHostSite, IID_IDocHostUIHandler, DocHostUIHandler)
#if (_WIN32_IE >= 0x0501) // IE 5.5 and higher
INTERFACE_PART(CDocHostSite, IID_IDocHostUIHandler2, DocHostUIHandler2)
#endif
INTERFACE_PART(CDocHostSite, IID_IInternetSecurityManager, InternetSecurityManager)
INTERFACE_PART(CDocHostSite, IID_IServiceProvider, ServiceProvider)
END_INTERFACE_MAP()
CDocHostSite::CDocHostSite(COleControlContainer * pOcc, CMyHtmlView* pView)
: COleControlSite( pOcc )
{
m_pView = pView;
}
CDocHostSite::~CDocHostSite()
{
}
ULONG CDocHostSite::XDocHostShowUI::AddRef()
{
METHOD_PROLOGUE(CDocHostSite, DocHostShowUI);
return pThis->ExternalAddRef();
}
ULONG CDocHostSite::XDocHostShowUI::Release()
{
METHOD_PROLOGUE(CDocHostSite, DocHostShowUI);
return pThis->ExternalRelease();
}
HRESULT CDocHostSite::XDocHostShowUI::QueryInterface(REFIID riid, void ** ppvObj)
{
METHOD_PROLOGUE(CDocHostSite, DocHostShowUI);
return pThis->ExternalQueryInterface( &riid, ppvObj );
}
HRESULT CDocHostSite::XDocHostShowUI::ShowHelp(HWND hwnd,
LPOLESTR pszHelpFile,
UINT nCommand,
DWORD dwData,
POINT ptMouse,
IDispatch * pDispatchObjectHit)
{
METHOD_PROLOGUE(CDocHostSite, DocHostShowUI);
return E_NOTIMPL;
}
HRESULT CDocHostSite::XDocHostShowUI::ShowMessage(HWND hwnd,
LPOLESTR lpstrText,
LPOLESTR lpstrCaption,
DWORD dwType,
LPOLESTR lpstrHelpFile,
DWORD dwHelpContext,
LRESULT * plResult)
{
METHOD_PROLOGUE(CDocHostSite, DocHostShowUI);
return pThis->m_pView->OnShowMessage(hwnd,lpstrText,lpstrCaption,dwType,lpstrHelpFile,dwHelpContext,plResult);
}
ULONG CDocHostSite::XDocHostUIHandler::AddRef()
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->ExternalAddRef();
}
ULONG CDocHostSite::XDocHostUIHandler::Release()
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->ExternalRelease();
}
HRESULT CDocHostSite::XDocHostUIHandler::QueryInterface(REFIID riid, void ** ppvObj)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->ExternalQueryInterface( &riid, ppvObj );
}
HRESULT CDocHostSite::XDocHostUIHandler::GetHostInfo(DOCHOSTUIINFO * pInfo)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnGetHostInfo( pInfo );
}
HRESULT CDocHostSite::XDocHostUIHandler::ShowUI(DWORD dwID,
IOleInPlaceActiveObject * pActiveObject,
IOleCommandTarget * pCommandTarget,
IOleInPlaceFrame * pFrame,
IOleInPlaceUIWindow * pDoc)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnShowUI( dwID, pActiveObject, pCommandTarget,
pFrame, pDoc );
}
HRESULT CDocHostSite::XDocHostUIHandler::HideUI()
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnHideUI();
}
HRESULT CDocHostSite::XDocHostUIHandler::UpdateUI()
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnUpdateUI();
}
HRESULT CDocHostSite::XDocHostUIHandler::EnableModeless(BOOL fEnable)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnEnableModeless( fEnable );
}
HRESULT CDocHostSite::XDocHostUIHandler::OnDocWindowActivate(BOOL fEnable)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnDocWindowActivate( fEnable );
}
HRESULT CDocHostSite::XDocHostUIHandler::OnFrameWindowActivate(BOOL fEnable)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnFrameWindowActivate( fEnable );
}
HRESULT CDocHostSite::XDocHostUIHandler::ResizeBorder(LPCRECT prcBorder,
IOleInPlaceUIWindow * pUIWindow,
BOOL fFrameWindow)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnResizeBorder( prcBorder, pUIWindow, fFrameWindow );
}
HRESULT CDocHostSite::XDocHostUIHandler::ShowContextMenu(DWORD dwID,
POINT * ppt,
IUnknown * pcmdtReserved,
IDispatch * pdispReserved)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnShowContextMenu( dwID, ppt, pcmdtReserved,
pdispReserved );
}
HRESULT CDocHostSite::XDocHostUIHandler::TranslateAccelerator(LPMSG lpMsg,
const GUID * pguidCmdGroup,
DWORD nCmdID)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return E_NOTIMPL;
return pThis->m_pView->OnTranslateAccelerator( lpMsg,
pguidCmdGroup, nCmdID );
}
HRESULT CDocHostSite::XDocHostUIHandler::GetOptionKeyPath(LPOLESTR * pchKey,
DWORD dw)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnGetOptionKeyPath( pchKey, dw );
}
HRESULT CDocHostSite::XDocHostUIHandler::GetDropTarget(IDropTarget * pDropTarget,
IDropTarget ** ppDropTarget)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnGetDropTarget( pDropTarget, ppDropTarget );
}
HRESULT CDocHostSite::XDocHostUIHandler::GetExternal(IDispatch ** ppDispatch)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnGetExternal( ppDispatch );
}
HRESULT CDocHostSite::XDocHostUIHandler::TranslateUrl(DWORD dwTranslate,
OLECHAR * pchURLIn,
OLECHAR ** ppchURLOut)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnTranslateUrl( dwTranslate, pchURLIn, ppchURLOut );
}
HRESULT CDocHostSite::XDocHostUIHandler::FilterDataObject(IDataObject * pDO,
IDataObject ** ppDORet)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler);
return pThis->m_pView->OnFilterDataObject( pDO, ppDORet );
}
#if (_WIN32_IE >= 0x0501) // IE 5.5 and higher
ULONG CDocHostSite::XDocHostUIHandler2::AddRef()
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler2);
return pThis->ExternalAddRef();
}
ULONG CDocHostSite::XDocHostUIHandler2::Release()
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler2);
return pThis->ExternalRelease();
}
HRESULT CDocHostSite::XDocHostUIHandler2::QueryInterface(REFIID riid, void ** ppvObj)
{
METHOD_PROLOGUE(CDocHostSite, DocHostUIHandler2);
return pThis->ExternalQueryInterface( &riid, ppvObj );
}
HRESULT CDocHostSite::XDocHostUIHandler2::GetHostInfo(DOCHOSTUIINFO *)
{
ASSERT(FALSE);
return S_FALSE;
}
HRESULT CDocHostSite::XDocHostUIHandler2::ShowUI(DWORD /*dwID*/,
IOleInPlaceActiveObject * /*pActiveObject*/,
IOleCommandTarget * /*pCommandTarget*/,
IOleInPlaceFrame * /*pFrame*/,
IOleInPlaceUIWindow * /*pDoc*/)
{
ASSERT(FALSE);
return S_FALSE;
}
HRESULT CDocHostSite::XDocHostUIHandler2::HideUI()
{
ASSERT(FALSE);
return S_FALSE;
}
HRESULT CDocHostSite::XDocHostUIHandler2::UpdateUI()
{
ASSERT(FALSE);
return S_FALSE;
}
HRESULT CDocHostSite::XDocHostUIHandler2::EnableModeless(BOOL /*fEnable*/)
{
ASSERT(FALSE);
return S_FALSE;
}
HRESULT CDocHostSite::XDocHostUIHandler2::OnDocWindowActivate(BOOL /*fActivate*/)
{
ASSERT(FALSE);
return S_FALSE;
}
HRESULT CDocHostSite::XDocHostUIHandler2::OnFrameWindowActivate(BOOL /*fActivate*/)
{
ASSERT(FALSE);
return S_FALSE;
}
HRESULT CDocHostSite::XDocHostUIHandler2::ResizeBorder(LPCRECT /*prcBorder*
没有合适的资源?快使用搜索试试~ 我知道了~
MFCHtmltest
共56个文件
png:19个
h:11个
cpp:7个
5星 · 超过95%的资源 需积分: 34 53 下载量 62 浏览量
2017-07-16
15:44:16
上传
评论 2
收藏 582KB ZIP 举报
温馨提示
本文实现了MFC对话框和JavaScript(HTML)的交互,具体可参加我的博客:MFC对话框里利用CHtmlView加载界面(三)————JaveScript 调用 MFC
资源推荐
资源详情
资源评论
收起资源包目录
MFCHtmlTest1.zip (56个子文件)
MFCHtmlTest1
DemoHtmlView.h 891B
IE2
index.html 10KB
images
prev.png 460B
next.png 1KB
favorable.png 1KB
left.png 38KB
2.jpg 46KB
right-arrow.png 1KB
bg.png 4KB
nextHigh.png 1KB
minimize.png 944B
close.png 985B
edit.png 283B
1.jpg 35KB
manage.png 364B
bank.png 2KB
prevHigh.png 1KB
left-arrow.png 232B
close2.png 171B
note.png 254B
right.png 1KB
minimize2.png 105B
3.jpg 217KB
js
statusLine.js 2KB
mfcCalljs.js 9KB
lib
jquery.js 82KB
echarts.common.min.js 365KB
statusPie.js 1KB
index.js 6KB
register.html 1KB
login.html 1KB
css
index.css 10KB
login.css 3KB
resource.h 1KB
Header.h 0B
MFCHtmlTest1.rc 11KB
bg.png 4KB
MFCHtmlTest1.cpp 2KB
DemoHtmlView.cpp 3KB
MFCHtmlTest1Dlg.cpp 9KB
stdafx.h 2KB
res
MFCHtmlTest1.ico 66KB
MFCHtmlTest1.rc2 680B
MyHtmlView.cpp 9KB
DocHostSite.h 7KB
stdafx.cpp 143B
MFCHtmlTest1Dlg.h 1KB
MyOleDropTarget.h 869B
MFCHtmlTest1.h 479B
Message.h 196B
MyOleDropTarget.cpp 3KB
DocHostSite.cpp 15KB
MyHtmlView.h 3KB
ClassDiagram.cd 3KB
targetver.h 234B
MFCHtmlTest1.sln 982B
共 56 条
- 1
资源评论
- zhoukaijun19882019-03-07这个资源非常好,很完美的实现了我的需求
- spygg2018-07-08不错吧,下载下来研究下
- lcyw2018-09-27不错的资源,。。
- lihaowei20282021-08-30缺少工程文件,无法加载工程
- chen0518b2020-07-16少东西啊,项目无法加载
白白皎皎
- 粉丝: 88
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功