www.pudn.com > Digihelper.rar > htojDlg.cpp


// htojDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "Digihelper.h" 
#include "htojDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// ChtojDlg dialog 
 
 
ChtojDlg::ChtojDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(ChtojDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(ChtojDlg) 
	m_htojin = 0.0; 
	m_htojredu = 0; 
	m_htojrefen = 0; 
	m_htojremiao = 0; 
	//}}AFX_DATA_INIT 
} 
 
 
void ChtojDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(ChtojDlg) 
	DDX_Text(pDX, IDC_htojin, m_htojin); 
	DDX_Text(pDX, IDC_htojredu, m_htojredu); 
	DDX_Text(pDX, IDC_htojrefen, m_htojrefen); 
	DDX_Text(pDX, IDC_htojremiao, m_htojremiao); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(ChtojDlg, CDialog) 
	//{{AFX_MSG_MAP(ChtojDlg) 
	ON_BN_CLICKED(IDhtojchange, Onhtojchange) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// ChtojDlg message handlers 
 
void ChtojDlg::Onhtojchange()  
{ 
	// TODO: Add your control notification handler code here 
	double htojz; 
	UpdateData(TRUE); 
	htojz=(m_htojin*180)/3.1415926; 
		m_htojredu=int(htojz); 
		m_htojrefen=int((htojz-m_htojredu)*60); 
		m_htojremiao=int(((htojz-m_htojredu)*60-m_htojrefen)*60); 
		UpdateData(FALSE); 
}