⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlgso2e.cpp

📁 Calculator program written by DLLs with the math algorithms such as automata and can draw some simpl
💻 CPP
字号:
// DlgSO2E.cpp : implementation file
//

#include "stdafx.h"
#include "CalculatorGUI.h"
#include "DlgSO2E.h"
#include "Lib/HePTDLL.h"
#include "Lib/CheckNumberDLL.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgSO2E dialog


CDlgSO2E::CDlgSO2E(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgSO2E::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgSO2E)
	m_vA1 = _T("");
	m_vA2 = _T("");
	m_vB1 = _T("");
	m_vB2 = _T("");
	m_vC1 = _T("");
	m_vC2 = _T("");
	m_vX = _T("");
	m_vY = _T("");
	m_vKQ = _T("");
	//}}AFX_DATA_INIT
}


void CDlgSO2E::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgSO2E)
	DDX_Text(pDX, IDC_EDIT_A1, m_vA1);
	DDX_Text(pDX, IDC_EDIT_A2, m_vA2);
	DDX_Text(pDX, IDC_EDIT_B1, m_vB1);
	DDX_Text(pDX, IDC_EDIT_B2, m_vB2);
	DDX_Text(pDX, IDC_EDIT_C1, m_vC1);
	DDX_Text(pDX, IDC_EDIT_C2, m_vC2);
	DDX_Text(pDX, IDC_EDIT_X, m_vX);
	DDX_Text(pDX, IDC_EDIT_Y, m_vY);
	DDX_Text(pDX, IDC_STATIC_KQ, m_vKQ);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgSO2E, CDialog)
	//{{AFX_MSG_MAP(CDlgSO2E)
	ON_BN_CLICKED(IDC_BUTTON_RESULT, OnButtonResult)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgSO2E message handlers

void CDlgSO2E::OnButtonResult() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	bool kq = FALSE;
	int hept;
	char *f;

	double a1 = strtod(m_vA1,&f);
	double b1 = strtod(m_vB1,&f);
	double c1 = strtod(m_vC1,&f);
	double a2 = strtod(m_vA2,&f);
	double b2 = strtod(m_vB2,&f);
	double c2 = strtod(m_vC2,&f);

	if (isNumeric(m_vA1))
	{
		if (isNumeric(m_vB1))
		{
			if (isNumeric(m_vC1))
			{
				if (isNumeric(m_vA2))
				{
					if (isNumeric(m_vB2))
					{
						if (isNumeric(m_vC2))
						{
							m_vX = "";
							m_vY = "";
							hept = he2pt(a1,b1,c1,a2,b2,c2,m_vX,m_vY);
							
							if (hept == 0)
							{
								m_vKQ = "This system has no root !!!";
							}
							else if (hept == 1)
							{
								m_vKQ = "This system has a countless number of roots !!!";
							}
							else if (hept == 2)
							{
								m_vKQ = "This system has unique root !!!";
							}
							kq = TRUE;
						}
					}
				}
			}
		}
	}
	
	if (kq == FALSE)
	{
		MessageBox("Please input correct data.");
	}

	UpdateData(FALSE);
}

BOOL CDlgSO2E::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	if (pMsg->message == WM_KEYDOWN)
    {
        if (pMsg->wParam == VK_RETURN){
            pMsg->wParam = NULL;
			OnButtonResult();
		}
    }

	return CDialog::PreTranslateMessage(pMsg);
}

BOOL CDlgSO2E::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
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -