CalDlg.cpp
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:1k
- // CalDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "新二十四点.h"
- #include "CalDlg.h"
- #include "新二十四点View.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CCalDlg dialog
- CCalDlg::CCalDlg(CMyView *view,CWnd* pParent /*=NULL*/)
- : CDialog(CCalDlg::IDD, pParent)
- {
- m_view=view;
- }
- void CCalDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CCalDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CCalDlg, CDialog)
- //{{AFX_MSG_MAP(CCalDlg)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CCalDlg message handlers
- void CCalDlg::OnButton1()
- {
- // TODO: Add your control notification handler code here
- int a,b,c,d;
- a=GetDlgItemInt(IDC_A);
- b=GetDlgItemInt(IDC_B);
- c=GetDlgItemInt(IDC_C);
- d=GetDlgItemInt(IDC_D);
- short mypoke[4]={a,b,c,d};
-
- m_view->Algorithum(mypoke);
- CListBox *listbox=(CListBox*)GetDlgItem(IDC_LISTRESULT);
- listbox->ResetContent();
- if(m_view->m_sArray.GetSize()==0)
- {
- listbox->AddString("没有答案");
- }
- else
- {
- for(int i=0;i<m_view->m_sArray.GetSize();i++)
- {
- listbox->AddString(m_view->m_sArray[i]);
- }
- }
- }