为对话框的一个Button空间加了一个CButton类型的变量,点击这个按钮,结果就出现了Wincore.cpp文件Line 980: 出错误.怎么回事? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 // CornSeed.cpp : implementation file//#include "stdafx.h"#include "Identification.h"#include "CornSeed.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCornSeed dialogCCornSeed::CCornSeed(CWnd* pParent /*=NULL*/) : CDialog(CCornSeed::IDD, pParent){ //{{AFX_DATA_INIT(CCornSeed) //}}AFX_DATA_INIT}void CCornSeed::DoDataExchange(CDataExchange* pDX){ CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CCornSeed) DDX_Control(pDX, IDOK, m_ok); //}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCornSeed, CDialog) //{{AFX_MSG_MAP(CCornSeed) //}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCornSeed message handlers#if !defined(AFX_CORNSEED_H__589AF1F7_BFC7_4397_8158_AAD75DFE3099__INCLUDED_)#define AFX_CORNSEED_H__589AF1F7_BFC7_4397_8158_AAD75DFE3099__INCLUDED_#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000// CornSeed.h : header file///////////////////////////////////////////////////////////////////////////////// CCornSeed dialogclass CCornSeed : public CDialog{// Constructionpublic: CCornSeed(CWnd* pParent = NULL); // standard constructor// Dialog Data //{{AFX_DATA(CCornSeed) enum { IDD = IDD_DIALOG_CORN }; CButton m_ok; //}}AFX_DATA// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CCornSeed) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL// Implementationprotected: // Generated message map functions //{{AFX_MSG(CCornSeed) virtual void OnOK(); //}}AFX_MSG DECLARE_MESSAGE_MAP()};//{{AFX_INSERT_LOCATION}}// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_CORNSEED_H__589AF1F7_BFC7_4397_8158_AAD75DFE3099__INCLUDED_)CCornSeed 是一个对话框类,m_ok是按钮控件的变量,我在上一层对话框用CCornSeed dlg;dlg.DoModal();的方式调用对话框,如果不定义m_ok,程序就好好的,一定义就出现上面的错误。 CPP文件里还做了其它的操作没?这么直接定义变量应该不会出错的啊.把CPP整个贴出来看看. 你重写了virtual void OnOK()?是不是里面的代码有问题啊,这么奇怪的问题第一次听说,而且两个人同时发生就更加奇怪了 m_ok 与你的对话框上的按钮控件关联起来了吗? 万能的大神,来帮我吧!!~~ CreateThread()的问题。。。 accept函数使用 如何得到其他窗口中的计数器值? [一点成就感都没有]《windows网络编程》第1章的例子程序 Win2000与Win2000连接的问题? VC等的别称 MFC的SOCKET编程怎么实现两个软件之间的通讯? 请教语音播放问题 程序修改,高手指点 ActiveX控件在自己电脑上编译后程序可以运行,到其他机器上有问题! 有哪个api可以弹出对话框同时可以选择文件或者目录的吗? 一个怪问题
//#include "stdafx.h"
#include "Identification.h"
#include "CornSeed.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CCornSeed dialog
CCornSeed::CCornSeed(CWnd* pParent /*=NULL*/)
: CDialog(CCornSeed::IDD, pParent)
{
//{{AFX_DATA_INIT(CCornSeed)
//}}AFX_DATA_INIT
}
void CCornSeed::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCornSeed)
DDX_Control(pDX, IDOK, m_ok);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCornSeed, CDialog)
//{{AFX_MSG_MAP(CCornSeed)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CCornSeed message handlers#if !defined(AFX_CORNSEED_H__589AF1F7_BFC7_4397_8158_AAD75DFE3099__INCLUDED_)
#define AFX_CORNSEED_H__589AF1F7_BFC7_4397_8158_AAD75DFE3099__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CornSeed.h : header file
///////////////////////////////////////////////////////////////////////////////
// CCornSeed dialogclass CCornSeed : public CDialog
{
// Construction
public:
CCornSeed(CWnd* pParent = NULL); // standard constructor// Dialog Data
//{{AFX_DATA(CCornSeed)
enum { IDD = IDD_DIALOG_CORN };
CButton m_ok;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCornSeed)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL// Implementation
protected: // Generated message map functions
//{{AFX_MSG(CCornSeed)
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_CORNSEED_H__589AF1F7_BFC7_4397_8158_AAD75DFE3099__INCLUDED_)CCornSeed 是一个对话框类,m_ok是按钮控件的变量,我在上一层对话框用CCornSeed dlg;dlg.DoModal();的方式调用对话框,如果不定义m_ok,程序就好好的,一定义就出现上面的错误。