resultdlg.cpp

来自「OpenSVM was developped under Visual C++ 」· C++ 代码 · 共 78 行

CPP
78
字号
// ResultDlg.cpp : implementation file
//

#include "stdafx.h"
#include "OpenSVM.h"
#include "ResultDlg.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)
	m_Output = _T("");
	//}}AFX_DATA_INIT
}


void CResultDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CResultDlg)
	DDX_Text(pDX, IDC_RESULT_CONTENT, m_Output);
	//}}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
	CFile datafile("C:\\tempView.tmp",CFile::modeRead);
	CArchive loadArchive(&datafile,CArchive::load);
	CString TextLine;
	
	UINT nr_line = 1;
	char c;
	for (UINT i = 0;i<(datafile.GetLength());i++)
	{
		loadArchive >> c;
		if (c == '\n') nr_line++;
	}
	datafile.SeekToBegin();
	
	for(i =0;i<nr_line;i++)
	{
		loadArchive.ReadString(TextLine);
		TextLine+="\r\n";
		m_Output+=TextLine;
	}
	
	loadArchive.Close();
	UpdateData(false);
	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 + -
显示快捷键?