?? resultdlg.cpp
字號:
// ResultDlg.cpp : implementation file
//
#include "stdafx.h"
#include "My1.h"
#include "ResultDlg.h"
#include <fstream.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResultDlg dialog
CResultDlg::CResultDlg(CWnd* pParent /*=NULL*/)
: CDialog(CResultDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CResultDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CResultDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CResultDlg)
DDX_Control(pDX, IDC_EDIT1, m_result);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CResultDlg, CDialog)
//{{AFX_MSG_MAP(CResultDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResultDlg message handlers
BOOL CResultDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
fstream infile;
infile.open("c://Data.txt",ios::in | ios::nocreate);
if(!infile) {
MessageBox("failed to open file!");
PostQuitMessage(0);
}
char buf[200];
while(infile.getline(buf,200))
{
m_result.FmtLines(true);
m_result.SetFocus();
m_result.ReplaceSel(buf,false);
m_result.ReplaceSel("\r\n");
}
infile.close();
DeleteFile("c://Data.txt");
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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -