📄 aadlg.cpp
字号:
// aaDlg.cpp : implementation file
//
#include "stdafx.h"
#include "aa.h"
#include "aaDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAaDlg dialog
CAaDlg::CAaDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAaDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAaDlg)
// 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 CAaDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAaDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAaDlg, CDialog)
//{{AFX_MSG_MAP(CAaDlg)
ON_BN_CLICKED(IDC_READ, OnRead)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAaDlg message handlers
BOOL CAaDlg::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
}
void CAaDlg::OnRead()
{
// Read value from driver
// ULONG wch[4096];
// FILE * fp;
DWORD dwBytesRead =32;
/////////////open str1
h=CreateFile(TEXT("STR1:"),GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
if (h==INVALID_HANDLE_VALUE)
{
::MessageBox(NULL,_T("Erro registry flush:"),_T("registry"),MB_OK);
}
///////////////////////////read boardid
// memset(&wch, '\0', 32 * sizeof(WCHAR));
// ::ReadFile(h, wch, 0x20, &dwBytesRead, NULL);
// fp=fopen("test.txt","w+");
// fprintf(fp,"device ID : %08x\n", wch[0]);
if(h!=NULL)
CloseHandle(h);
// ::MessageBox(NULL,_T("Flush Registry:begin"),_T("STRApp"),MB_OK);
h=NULL;
// ::MessageBox(NULL,_T("Flush Registry:succeed"),_T("STRApp"),MB_OK);
::MessageBox(NULL,_T("保存设置成功"),_T("STRApp"),MB_OK);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -