📄 querydlg.cpp
字号:
// QUERYDLG.cpp : implementation file
//
#include "stdafx.h"
#include "SMESWHY.h"
#include "QUERYDLG.h"
#include "string.h"
#include "winbase.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// QUERYDLG dialog
QUERYDLG::QUERYDLG(CWnd* pParent /*=NULL*/)
: CDialog(QUERYDLG::IDD, pParent)
{
//{{AFX_DATA_INIT(QUERYDLG)
m_editquestion = _T("");
m_editjsj = _T("");
m_editxf = _T("");
m_editzjjl = _T("");
//}}AFX_DATA_INIT
}
void QUERYDLG::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(QUERYDLG)
DDX_Control(pDX, IDC_EDITZJJL, m_editzjjlctl);
DDX_Control(pDX, IDC_EDITXF, m_editxfctl);
DDX_Control(pDX, IDC_EDITJSJ, m_editjsjctl);
DDX_Control(pDX, IDC_STATICQESTION, m_staticquestion);
DDX_Control(pDX, IDC_EDITQUESTION, m_editquery);
DDX_Text(pDX, IDC_EDITQUESTION, m_editquestion);
DDX_Text(pDX, IDC_EDITJSJ, m_editjsj);
DDX_Text(pDX, IDC_EDITXF, m_editxf);
DDX_Text(pDX, IDC_EDITZJJL, m_editzjjl);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(QUERYDLG, CDialog)
//{{AFX_MSG_MAP(QUERYDLG)
ON_EN_CHANGE(IDC_EDITQUESTION, OnChangeEditquestion)
ON_EN_UPDATE(IDC_EDITQUESTION, OnUpdateEditquestion)
ON_BN_CLICKED(IDC_BUTTONTL, OnButtontl)
ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// QUERYDLG message handlers
void QUERYDLG::OnOK()
{
// TODO: Add extra validation here
int res;
if(res=IDOK)
{
MessageBox("您确实要结束推理返回主系统吗");
m_editquery.SetWindowText(" ");
m_editjsjctl.SetWindowText(" ");
m_editxfctl.SetWindowText(" ");
m_editzjjlctl.SetWindowText(" ");
}
CDialog::OnOK();
}
void QUERYDLG::OnCancel()
{
// TODO: Add extra cleanup here
int res;
if(res=IDCANCEL)
{MessageBox("您确实要取消推理吗");
m_editquery.SetWindowText(" ");
m_editjsjctl.SetWindowText(" ");
m_editxfctl.SetWindowText(" ");
m_editzjjlctl.SetWindowText(" ");
}
CDialog::OnCancel();
}
void QUERYDLG::OnChangeEditquestion()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void QUERYDLG::OnUpdateEditquestion()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
}
void QUERYDLG::OnButtontl()
{
// TODO: Add your control notification handler code here
bool english=false;
bool computer=false;
bool mark=false;
if(benkexueli)
{
m_editquery.SetWindowText("请在这里输入您要询问的问题:");
m_editjsjctl.SetWindowText("请在这里输入您要询问的问题:");
m_editxfctl.SetWindowText("请在这里输入您要询问的问题:");
for(int i=0;i<1000;i++)
{
}
m_editquery.SetWindowText(" ");
m_editquery.GetWindowText(m_editquestion);
if(!strcmp(m_editquestion,"大学英语四级"))
english=true;
if(english)
MessageBox("您确认已经通过大学英语四级考试","四级英语证书确认",MB_OK);
m_editquery.SetWindowText("您确认已经通过大学英语四级考试");
if(!english)
MessageBox("您还没有通过大学英语四级考试,肯定无法取得本科学位,可能会毕业?","四级英语证书确认",MB_OK);
m_editquery.SetWindowText("您还没有通过大学英语四级考试");
//int reply1;
m_staticquestion.SetWindowText("您还要继续询问专家吗?");
//if(reply1=AfxMessageBox("您还要继续询问专家吗?"专家系统推理机",MB_OK))
for(i=0;i<1000;i++)
{
}
m_editjsjctl.SetWindowText(" ");
m_editjsjctl.GetWindowText(m_editjsj);
if(!strcmp(m_editjsj,"计算机等级考试"))
computer=true;
if(computer)
MessageBox("您确认已经通过计算机等级考试了吗?","计算机等级考试证书确认",MB_OK);
m_editjsjctl.SetWindowText("您已经通过计算机等级考试");
if(!computer)
MessageBox("您还没有通过计算机等级考试,肯定无法取得本科学位,可能会毕业?","计算机等级考试证书确认",MB_OK);
m_editjsjctl.SetWindowText("您还没有通过计算机等级考试");
//int reply2;
m_staticquestion.SetWindowText("您还要继续询问专家吗?");
// if(reply2=AfxMessageBox("您还要继续询问专家吗?"专家系统推理机",MB_YesOK))
for(i=0;i<1000;i++)
{
}
m_editxfctl.SetWindowText(" ");
m_editxfctl.GetWindowText(m_editxf);
if(!strcmp(m_editxf,"修完了所有的学分"))
mark=true;
if(mark)
MessageBox("您确认已经修完了所有的学分了吗?","学分确认",MB_OK);
m_editxfctl.SetWindowText("您已经修完了所有的学分");
if(!mark)
MessageBox("您还没有修完了所有的学分,肯定无法取得毕业","学分确认",MB_OK);
m_editxfctl.SetWindowText("您还没有修完了所有的学分");
m_staticquestion.SetWindowText("您已经询问了专家三个问题,明白了吗?");
if(english&&computer&&mark)
MessageBox("您已经修完了所有的学分,能够毕业,可以获得学位","确认",MB_OK);
m_editzjjlctl.SetWindowText("您已经修完了所有的学分,能够毕业,可以获得学位");
if(!(english&&computer)&&mark)
MessageBox("您已经修完了所有的学分,能够毕业","确认",MB_OK);
m_editzjjlctl.SetWindowText("您已经修完了所有的学分,能够毕业,很遗憾无法获得学位");
if(!mark)
MessageBox("您没有修完了所有的学分,不能毕业","确认",MB_OK);
m_editzjjlctl.SetWindowText("您没有修完了所有的学分,真不幸,您不能毕业");
}
if(zhuankexueli)
{
//m_editquery.SetWindowText("请在这里输入您要询问的问题:");
m_editquery.EnableWindow(false);
m_editjsjctl.SetWindowText("请在这里输入您要询问的问题:");
m_editxfctl.SetWindowText("请在这里输入您要询问的问题:");
/* for(int i=0;i<1000;i++)
{
}
m_editquery.SetWindowText(" ");
m_editquery.GetWindowText(m_editquestion);
if(!strcmp(m_editquestion,"大学英语四级"))
english=true;
if(english)
MessageBox("您确认已经通过大学英语四级考试","四级英语证书确认",MB_OK);
m_editquery.SetWindowText("您确认已经通过大学英语四级考试");
if(!english)
MessageBox("您还没有通过大学英语四级考试,肯定无法取得本科学位,可能会毕业?","四级英语证书确认",MB_OK);
m_editquery.SetWindowText("您还没有通过大学英语四级考试");
//int reply1;
m_staticquestion.SetWindowText("您还要继续询问专家吗?");
//if(reply1=AfxMessageBox("您还要继续询问专家吗?"专家系统推理机",MB_OK))
*/
for(int i=0;i<1000;i++)
{
}
m_editjsjctl.SetWindowText(" ");
m_editjsjctl.GetWindowText(m_editjsj);
if(!strcmp(m_editjsj,"计算机等级考试"))
computer=true;
if(computer)
MessageBox("您确认已经通过计算机等级考试了吗?","计算机等级考试证书确认",MB_OK);
m_editjsjctl.SetWindowText("您已经通过计算机等级考试");
if(!computer)
MessageBox("您还没有通过计算机等级考试,肯定无法取得本科学位,可能会毕业?","计算机等级考试证书确认",MB_OK);
m_editjsjctl.SetWindowText("您还没有通过计算机等级考试");
//int reply2;
m_staticquestion.SetWindowText("您还要继续询问专家吗?");
// if(reply2=AfxMessageBox("您还要继续询问专家吗?"专家系统推理机",MB_YesOK))
for(i=0;i<1000;i++)
{
}
m_editxfctl.SetWindowText(" ");
m_editxfctl.GetWindowText(m_editxf);
if(!strcmp(m_editxf,"修完了所有的学分"))
mark=true;
if(mark)
MessageBox("您确认已经修完了所有的学分了吗?","学分确认",MB_OK);
m_editxfctl.SetWindowText("您已经修完了所有的学分");
if(!mark)
MessageBox("您还没有修完了所有的学分,肯定无法取得毕业","学分确认",MB_OK);
m_editxfctl.SetWindowText("您还没有修完了所有的学分");
m_staticquestion.SetWindowText("您已经询问了专家两个问题,明白了吗?");
if(computer&&mark)
MessageBox("您已经修完了所有的学分,能够毕业,可以获得学位","确认",MB_OK);
m_editzjjlctl.SetWindowText("您已经修完了所有的学分,能够毕业,可以获得学位");
if((!computer)&&mark)
MessageBox("您已经修完了所有的学分,能够毕业","确认",MB_OK);
m_editzjjlctl.SetWindowText("您已经修完了所有的学分,能够毕业,很遗憾无法获得学位");
if(!mark)
MessageBox("您没有修完了所有的学分,不能毕业","确认",MB_OK);
m_editzjjlctl.SetWindowText("您没有修完了所有的学分,真不幸,您不能毕业");
}
}
void QUERYDLG::OnRadio1()
{
// TODO: Add your control notification handler code here
benkexueli=true;
zhuankexueli=false;
}
void QUERYDLG::OnRadio2()
{
// TODO: Add your control notification handler code here
benkexueli=false;
zhuankexueli=true;
}
void QUERYDLG::OnButton1()
{
// TODO: Add your control notification handler code here
WinExec("d:\\smeswhy\\stuman.exe",SW_MAXIMIZE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -