?? testramdlg.cpp
字號(hào):
// testRAMDlg.cpp : implementation file
//
#include "stdafx.h"
#include "testRAM.h"
#include "testRAMDlg.h"
#include "DllHead.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
HANDLE hndMem; /* define the handle of the RAM */
/////////////////////////////////////////////////////////////////////////////
// CTestRAMDlg dialog
CTestRAMDlg::CTestRAMDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestRAMDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestRAMDlg)
m_address = 0;
m_WriteChar = 0;
m_ReadChar = 0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CTestRAMDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestRAMDlg)
DDX_Text(pDX, IDC_ADDR_EDIT1, m_address);
DDV_MinMaxInt(pDX, m_address, 0, 8191);
DDX_Text(pDX, IDC_WriteChar_EDIT2, m_WriteChar);
DDV_MinMaxByte(pDX, m_WriteChar, 0, 255);
DDX_Text(pDX, IDC_ReadChar_EDIT3, m_ReadChar);
DDV_MinMaxByte(pDX, m_ReadChar, 0, 255);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTestRAMDlg, CDialog)
//{{AFX_MSG_MAP(CTestRAMDlg)
ON_BN_CLICKED(IDC_WriteChar_BUTTON1, OnWriteCharBUTTON1)
ON_BN_CLICKED(IDC_ReadChar_BUTTON2, OnReadCharBUTTON2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestRAMDlg message handlers
BOOL CTestRAMDlg::OnInitDialog()
{
CDialog::OnInitDialog();
hndMem=GetHandle(2); /* get the handle of RAM */
// 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
}
void CTestRAMDlg::OnWriteCharBUTTON1() /* Write char to memory */
{
// TODO: Add your control notification handler code here
UCHAR tempbuf;
UpdateData(true);
tempbuf=m_WriteChar;
WriteChar(hndMem,m_address,tempbuf);
}
void CTestRAMDlg::OnReadCharBUTTON2()
{
// TODO: Add your control notification handler code here
UpdateData(true);
m_ReadChar=ReadChar(hndMem,m_address);
UpdateData(false);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -