www.pudn.com > LJ_Pre_Modified_1.4.rar > OUTPUT.cpp


// OUTPUT.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "LJ.h" 
#include "OUTPUT.h" 
#include "OMP.h" 
#include "LJDlg.h" 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// OUTPUT dialog 
extern CLJDlg *pLJDlg; 
 
OUTPUT::OUTPUT(CWnd* pParent /*=NULL*/) 
	: CDialog(OUTPUT::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(OUTPUT) 
	m_KKX = 0.0f; 
	m_KYX = 0.0f; 
	m_SCX = 0.0f; 
	m_YXX = 0.0f; 
	//}}AFX_DATA_INIT 
	m_KKX = pLJDlg ->KKX; 
	m_KYX = pLJDlg ->KYX; 
	m_SCX = pLJDlg ->SCX; 
	m_YXX = pLJDlg ->YXX; 
} 
 
 
void OUTPUT::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(OUTPUT) 
	DDX_Text(pDX, IDC_KKX, m_KKX); 
	DDX_Text(pDX, IDC_KYX, m_KYX); 
	DDX_Text(pDX, IDC_SCX, m_SCX); 
	DDX_Text(pDX, IDC_YXX, m_YXX); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(OUTPUT, CDialog) 
	//{{AFX_MSG_MAP(OUTPUT) 
	ON_BN_CLICKED(IDC_COMP, OnComp) 
	ON_BN_CLICKED(IDC_SAVE, OnSave) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// OUTPUT message handlers 
 
void OUTPUT::OnComp()  
{ 
	// TODO: Add your control notification handler code here 
	 
	FILE *fp; 
	if (NULL == (fp = fopen("abc","r"))) 
	{ 
		MessageBox(_T("请先保存比较对象!")); 
		return; 
	} 
	COMP comp; 
	comp.DoModal(); 
} 
 
BOOL OUTPUT::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 
} 
 
void OUTPUT::OnSave()  
{ 
	// TODO: Add your control notification handler code here 
	FILE *fp; 
	fp = fopen("abc","w"); 
	if (fp == NULL) 
	{ 
		AfxMessageBox("打开文件失败!"); 
		return; 
	} 
	fprintf(fp,"%f,%f,%f,%f",m_KKX, m_KYX, m_SCX, m_YXX); 
	fclose(fp); 
}