📄 dlgtest.cpp
字号:
// DlgTest.cpp : implementation file
//
#include "stdafx.h"
#include "NeuralNetwork.h"
#include "DlgTest.h"
#include "MainFrm.h"
#include "NeuralNetworkDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgTest dialog
CDlgTest::CDlgTest(CWnd* pParent /*=NULL*/)
: CDialog(CDlgTest::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgTest)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgTest::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgTest)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgTest, CDialog)
//{{AFX_MSG_MAP(CDlgTest)
ON_BN_CLICKED(IDC_BTN_TEST, OnBtnTest)
ON_BN_CLICKED(IDC_BTN_RESULT, OnBtnResult)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgTest message handlers
void CDlgTest::OnBtnTest()
{
// TODO: Add your control notification handler code here
CFileDialog dlgOpen(TRUE,_T("txt"),_T(".txt"),OFN_OVERWRITEPROMPT,_T("文本文件(*.txt)|*.txt|"));
if(IDOK==dlgOpen.DoModal())
{
CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
CNeuralNetworkDoc* pDoc = (CNeuralNetworkDoc*) pMainFrame->GetActiveDocument();
SetDlgItemText(IDC_EDIT_TEST,dlgOpen.GetPathName());
}
else
{
AfxMessageBox("文件无法打开!");
}
}
void CDlgTest::OnBtnResult()
{
// TODO: Add your control notification handler code here
CFileDialog dlgOpen(TRUE,_T("txt"),_T(".txt"),OFN_OVERWRITEPROMPT,_T("文本文件(*.txt)|*.txt|"));
if(IDOK==dlgOpen.DoModal())
{
CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
CNeuralNetworkDoc* pDoc = (CNeuralNetworkDoc*) pMainFrame->GetActiveDocument();
SetDlgItemText(IDC_EDIT_RESULT,dlgOpen.GetPathName());
}
else
{
AfxMessageBox("文件无法打开!");
}
}
void CDlgTest::OnOK()
{
// TODO: Add extra validation here
CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
CNeuralNetworkDoc* pDoc = (CNeuralNetworkDoc*) pMainFrame->GetActiveDocument();
CString inputFileName,outputFileName;
GetDlgItemText(IDC_EDIT_TEST,inputFileName);
GetDlgItemText(IDC_EDIT_RESULT,outputFileName);
pDoc->neuralNetwork.networkResult(inputFileName,outputFileName);
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -