propertydlg.cpp

来自「不说了」· C++ 代码 · 共 80 行

CPP
80
字号
// PropertyDlg.cpp : implementation file
//

#include "stdafx.h"
#include "counting.h"
#include "PropertyDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPropertyDlg dialog


CPropertyDlg::CPropertyDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CPropertyDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CPropertyDlg)
	m_nStatMethod = -1;
	m_strLogFile = _T("");
	//}}AFX_DATA_INIT
}


void CPropertyDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPropertyDlg)
	DDX_Radio(pDX, IDC_STAT_METHOD, m_nStatMethod);
	DDX_Text(pDX, IDC_LOG_FILE, m_strLogFile);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPropertyDlg, CDialog)
	//{{AFX_MSG_MAP(CPropertyDlg)
	ON_BN_CLICKED(IDC_BROWSE_LOG_FILE, OnBrowseLogFile)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPropertyDlg message handlers

void CPropertyDlg::OnBrowseLogFile() 
{
	// TODO: Add your control notification handler code here
	CFileDialog dlgFile(TRUE, "", NULL, 
		OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY,
		NULL, this);

	dlgFile.m_ofn.lStructSize = sizeof(OPENFILENAME);
	static char BASED_CODE szFilter[]
		= "Text File(.txt)\0*.txt\0All Files (*.*)\0*.*\0\0";

	dlgFile.m_ofn.lpstrFilter = szFilter;
//	char FileName[640];
//	memset(FileName, 0, sizeof(FileName));
//	dlgFile.m_ofn.lpstrFile = FileName;
//	dlgFile.m_ofn.nMaxFile = 640;

	if(dlgFile.DoModal()==IDOK)
	{
		m_strLogFile = dlgFile.GetPathName();
		UpdateData(FALSE);
	}
}

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

⌨️ 快捷键说明

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