做好对话画框后,生成对话框类编译,连接都没问题,就是运行的时候没反应,也没报错,找不出问题后,我重做了遍,在没生成对话框类前是没问题的,生成了新类,成员变量初始化后就运行却没反应了
已经试过几次,求解~~~~我是新学
OnInitDialog的代码
// Eg71Dialog.cpp : implementation file
//#include "stdafx.h"
#include "Eg7_1.h"
#include "Eg71Dialog.h"//这是我设置生成的新类名#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CEg71Dialog dialog
CEg71Dialog::CEg71Dialog(CWnd* pParent /*=NULL*/)
: CDialog(CEg71Dialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CEg71Dialog)
m_Edit = _T("");
m_Email = _T("");
m_Name = _T("");
//}}AFX_DATA_INIT
}
void CEg71Dialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEg71Dialog)
DDX_Control(pDX, IDC_COMBO2, m_Province);
DDX_Control(pDX, IDC_COMBO1, m_City);
DDX_Text(pDX, IDC_EDIT_EDIT, m_Edit);
DDX_Text(pDX, IDC_EDIT_EMAIL, m_Email);
DDX_Text(pDX, IDC_EDIT_NAME, m_Name);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEg71Dialog, CDialog)
//{{AFX_MSG_MAP(CEg71Dialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CEg71Dialog message handlersBOOL CEg71Dialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_Province.AddString("湖南");
m_Province.AddString("河南");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
已经试过几次,求解~~~~我是新学
OnInitDialog的代码
// Eg71Dialog.cpp : implementation file
//#include "stdafx.h"
#include "Eg7_1.h"
#include "Eg71Dialog.h"//这是我设置生成的新类名#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CEg71Dialog dialog
CEg71Dialog::CEg71Dialog(CWnd* pParent /*=NULL*/)
: CDialog(CEg71Dialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CEg71Dialog)
m_Edit = _T("");
m_Email = _T("");
m_Name = _T("");
//}}AFX_DATA_INIT
}
void CEg71Dialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEg71Dialog)
DDX_Control(pDX, IDC_COMBO2, m_Province);
DDX_Control(pDX, IDC_COMBO1, m_City);
DDX_Text(pDX, IDC_EDIT_EDIT, m_Edit);
DDX_Text(pDX, IDC_EDIT_EMAIL, m_Email);
DDX_Text(pDX, IDC_EDIT_NAME, m_Name);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEg71Dialog, CDialog)
//{{AFX_MSG_MAP(CEg71Dialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CEg71Dialog message handlersBOOL CEg71Dialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_Province.AddString("湖南");
m_Province.AddString("河南");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
就是加了控件后,打开Class wizard或Ctrl+W,就提示要建立新类了~~~~~上面显示Great。要我输入新类名,完成这些后,我就运行
所以我就奇怪啊~~~编译和连接都没问题的(也就是说代码应该没问题的),就是按运行就没反应啊~~
说了这么你能说说我这个可能是什么问题了吗??谢了