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

📄 ceocxhostdlg.cpp

📁 《Windows CE 权威指南》(作者:(美)CHRIS MUENCH
💻 CPP
字号:
// CeOCXHostDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CeOCXHost.h"
#include "CeOCXHostDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCeOCXHostDlg dialog

CCeOCXHostDlg::CCeOCXHostDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCeOCXHostDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCeOCXHostDlg)
	m_lOutVal = 0;
	m_lInVal = 0;
	m_strInString = _T("");
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CCeOCXHostDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCeOCXHostDlg)
	DDX_Control(pDX, IDC_HEXCONV1, m_ctrlHexConv);
	DDX_Text(pDX, IDC_OUTVAL, m_lOutVal);
	DDX_Text(pDX, IDC_INVAL, m_lInVal);
	DDX_Text(pDX, IDC_INSTR, m_strInString);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CCeOCXHostDlg, CDialog)
	//{{AFX_MSG_MAP(CCeOCXHostDlg)
	ON_BN_CLICKED(IDC_SETIN, OnSetin)
	ON_BN_CLICKED(IDC_GETOUT, OnGetout)
	ON_BN_CLICKED(IDC_SETSTR, OnSetstr)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCeOCXHostDlg message handlers

BOOL CCeOCXHostDlg::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

	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}


//<BOOK_ADDON Chapter 6.4.3> ****************************************
void CCeOCXHostDlg::OnSetin() 
{
	UpdateData(TRUE);
	m_ctrlHexConv.SetInValue(m_lInVal);
	
}

void CCeOCXHostDlg::OnGetout() 
{
	m_lOutVal=m_ctrlHexConv.GetOutValue();
	UpdateData(FALSE);
	
}

void CCeOCXHostDlg::OnSetstr() 
{
	UpdateData(TRUE);
	m_ctrlHexConv.SetDisplayString(m_strInString);
	
}

BEGIN_EVENTSINK_MAP(CCeOCXHostDlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CCeOCXHostDlg)
	ON_EVENT(CCeOCXHostDlg, IDC_HEXCONV1, 1 /* OnOutChange */, OnOutChangeHexconv1, VTS_NONE)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

void CCeOCXHostDlg::OnOutChangeHexconv1() 
{
	m_lOutVal=m_ctrlHexConv.GetOutValue(); 
	UpdateData(FALSE);
}
//</BOOK_ADDON Chapter 6.4.3> ****************************************

⌨️ 快捷键说明

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