lz现在在做一个编辑框的数据传递功能控件,是希望将自己输入的数据编程程序运行的一个参数,在这个过程中我设了这个对话框单独设了一个类,经过调试感觉总也不对,之后我用逐步调试的方法,发现了错误的根源: m_DeltaDialog.DoModal();相应弹出的对话框为:
Debug Assertion Failed!Program:XXX
File:XXX
Line:XXFor information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts然后就不明白了.......不知道该如何解决,希望大家帮帮忙,谢谢~
以下是那个对话框对应的类函数:
.h文件:#if !defined(AFX_DELTAINPUT_H__8280DA29_BB8C_475E_8E00_A2A854AB53EF__INCLUDED_)
#define AFX_DELTAINPUT_H__8280DA29_BB8C_475E_8E00_A2A854AB53EF__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DeltaInput.h : header file
///////////////////////////////////////////////////////////////////////////////
// DeltaInput dialogclass DeltaInput : public CDialog
{
// Construction
public:
int DeltaGet;
BOOL DeltaContinue; DeltaInput(CWnd* pParent = NULL);   // standard constructor
// Dialog Data
//{{AFX_DATA(DeltaInput)
enum { IDD = IDD_DeltaInput };
CEdit m_DeltaEdit;
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DeltaInput)
protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
//}}AFX_VIRTUAL// Implementation
protected: // Generated message map functions
//{{AFX_MSG(DeltaInput)
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_DELTAINPUT_H__8280DA29_BB8C_475E_8E00_A2A854AB53EF__INCLUDED_)
.cpp文件:// DeltaInput.cpp : implementation file
//#include "stdafx.h"
#include "image.h"
#include "DeltaInput.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// DeltaInput dialog
DeltaInput::DeltaInput(CWnd* pParent /*=NULL*/)
: CDialog(DeltaInput::IDD, pParent)
{
//{{AFX_DATA_INIT(DeltaInput)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void DeltaInput::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DeltaInput)
// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Control(pDX, IDD_DeltaInput, m_DeltaEdit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DeltaInput, CDialog)
//{{AFX_MSG_MAP(DeltaInput)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// DeltaInput message handlersvoid DeltaInput::OnOK() 
{
// TODO: Add extra validation here
CString Delta_String;
m_DeltaEdit.GetWindowText(Delta_String);
DeltaGet = atoi(Delta_String);
if(DeltaGet > 10)
DeltaGet = 10;
DeltaContinue = TRUE; CDialog::OnOK();
}