⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xhtmldlg.cpp

📁 wince下面
💻 CPP
字号:
// XHtmlDlg.cpp : implementation file
//

#include "stdafx.h"
#include "XHtml.h"
#include "XHtmlDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CXHtmlDlg dialog

CXHtmlDlg::CXHtmlDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CXHtmlDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CXHtmlDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CXHtmlDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CXHtmlDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CXHtmlDlg, CDialog)
	//{{AFX_MSG_MAP(CXHtmlDlg)
	ON_BN_CLICKED(IDC_LOAD, OnLoad)
	ON_BN_CLICKED(IDC_QUIT, OnQuit)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CXHtmlDlg message handlers

BOOL CXHtmlDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	CenterWindow(GetDesktopWindow());	// center to the hpc screen

	MoveWindow(0,0,240,320);
	::SetWindowPos(m_hWnd,HWND_TOPMOST,0,0,240,320,SWP_SHOWWINDOW);
	// TODO: Add extra initialization here
	myIE.MyInit(CRect(10,10,230,260),this);//初始化IE控件

		m_pFileName = L"";//测试XML是否冲突
	LoadXML();
	return TRUE;  // return TRUE  unless you set the focus to a control
}

HRESULT CXHtmlDlg::LoadXML()
{
	HRESULT    hr;
	VARIANT_BOOL	status;
	hr = CoCreateInstance (CLSID_DOMDocument, NULL,
		CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
		IID_IXMLDOMDocument, (LPVOID *)&m_pXMLDoc);
	if(m_pXMLDoc)
	{
		hr = m_pXMLDoc->load(COleVariant(m_pFileName),&status);
	}
	return hr;
}


void CXHtmlDlg::OnLoad() 
{
	// TODO: Add your control notification handler code here
		myIE.Nav2URL(TEXT("file://\\CF_Storage\\Chinese Culture\\index-history.htm"));
}

void CXHtmlDlg::OnQuit() 
{
	// TODO: Add your control notification handler code here
	OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -