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

📄 dlgtest.cpp

📁 在WinCE环境下,不同的AP可能需要共享数据,信息,该例子就是几个不同的AP来读写同一块内存的例子.
💻 CPP
字号:
// DlgTest.cpp : implementation file
//

#include "stdafx.h"
#include "MemoryDemoMain.h"
#include "DlgTest.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgTest dialog


CDlgTest::CDlgTest(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgTest::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgTest)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


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


BEGIN_MESSAGE_MAP(CDlgTest, CDialog)
	//{{AFX_MSG_MAP(CDlgTest)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgTest message handlers

BOOL CDlgTest::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetTimer(1,1000,NULL);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgTest::OnTimer(UINT nIDEvent) 
{
	CWnd*  hWnd = GetForegroundWindow();
	CMemoryDemoMainApp* ptheApp = (CMemoryDemoMainApp*) AfxGetApp();
	if(hWnd != ptheApp->m_pDlg1 && hWnd != ptheApp->m_pDlg2)
	{
		KillTimer(1);
		CDialog::OnCancel();
		DestroyWindow();
// 		MessageBox(_T("hello2"),NULL,MB_OK);
	}
	CDialog::OnTimer(nIDEvent);
}

void CDlgTest::OnOK() 
{
	// TODO: Add extra validation here
//	CDialog::OnOK();
	DestroyWindow();

}

⌨️ 快捷键说明

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