MFC will add their own buttons too many mistakes ?

Category: VC/MFC -> UI Author: cfy_masic Date: 2007-12-19 11:17:59
 
cfy_masic
2007-12-19 11:17:59
I built a MFC based on the basic dialog project called EasyCoding , add two buttons in CEasyCodingDlg class follows
protected:
int   bw, bh;     // button width
CButton   cb1, cb2;
two buttons are used to open a new dialog box , which features two buttons and operate the new dialog has been completed and can be run successfully.
However, when I add a third button cb3, as
protected:
int   bw, bh;     // button aspect
CButton   cb1, cb2, cb3;
compile and run , it will prompt an error message after exiting ......

done before a project , they also had a similar problem , I put on the corresponding button to define a new Cpp file class is defined as a global variable can be resolved ( will not prompt an error ) , but this is my definition in a pop-up dialog box corresponding to each button has a return to the main dialog back button . Once I opened the button to the dialog child in the way global variables defined in the main dialog cpp , click on the button will return the child dialog error . I repeat this error and the error using CButton :: Create somewhat similar . So :

1. problem will be re- Create the dialog box that appears in the sub- click return it? But my way is to open the dialog box OnOK () off his own re- define the new dialog DoModel (), so that is returned , in fact, create a new class of objects , the feeling should not be a problem redefined ah?

2.VC controls variables need to be deleted after use with certain functions it? Use those function? The example CButton, similar to our own , as DeleteObject or ReleaseDC release memory space it?

3. back to the original question, I added a cb3 much will go wrong, but in the same way to add cb1 , cb2 when there is no problem, I really said that very difficult to understand , if it is Could it be that the memory resource issues statement on completion of one or two buttons occupy my memory of it? Or add a member variable in the main dialog already unreasonable it? Wang expert guidance.

4. Question 3 will be a bug my VC it ? Have you encountered a similar situation it ?

Heroes seek expert ...... Come ah !
YOYO_diy1312
2007-12-19 11:20:31
" button to add their own " so one ?
CButton   cb1, cb2, cb3;
should be no problem .
What is wrong ?
yw060082
2007-12-19 11:36:23
is how you say that you pop up the dialog, the dialog box does not know is not repeated establish
wyd361
2007-12-19 11:54:34
may be caused by life-cycle .

wu_zhenwei
2007-12-19 12:01:06
do not know how your code is written
cmfuklz1
2007-12-19 12:08:00
Why not add a button tool it
qiner241
2007-12-19 12:12:24
see you describe is not so good analysis
button ID is not a conflict
csdown001
2007-12-19 12:31:59
really do not know ah, you come up with the landlord or the project description to let everyone give you a look at it
sunppliying
2007-12-19 12:46:27
error message is what ah?
zfcaws
2007-12-19 12:59:03
or paste code , or texture , or . This just some text and detailed description . For example, " two buttons are used to open a new dialog "
here should describe :
1, the button is created dynamically or statically created, create a method
2, Dialog is created dynamically or statically created, create a method
3 ,. . . . The following description is similar
lala12315
2007-12-19 13:15:00
landlord does not understand how to do
pauly_yang
2007-12-19 13:28:38
define the main dialog (.h) file that defines the button in the last two lines , the current I have in this .cpp file corresponding button cb3, cb4, definition cb5 , so I put the button definition CButton   cb1, cb2; instead CButton   cb1, cb2, cb6; but until then the compiler will directly pop up error information , saying that my application has stopped working .

class CEasyCodingDlg : public CDialog
{
// Construction
public:
void MyPaint(HDC hdc);
CEasyCodingDlg(CWnd* pParent = NULL); // standard constructor

// Dialog Data
//{{AFX_DATA(CEasyCodingDlg)
enum { IDD = IDD_EASYCODING_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEasyCodingDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
HICON m_hIcon;

// Generated message map functions
//{{AFX_MSG(CEasyCodingDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnCoding1();
afx_msg void OnCoding2();
afx_msg void OnCoding3();
afx_msg void OnCoding4();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
CRgn m_rgnWnd;
protected:
int bw,bh;  //
CButton cb1,cb2;
};
dandanlg
2007-12-19 13:43:30
.cpp main dialog file , which contains the definition for the class members can no longer be defined initialize global buttons and button response messages, etc.

// EasyCodingDlg.cpp : implementation file
//

#include "stdafx.h"
#include "EasyCoding.h"
#include "EasyCodingDlg.h"

#include "CodingDlg1.h"
#include "CodingDlg2.h"
#include "CodingDlg3.h"
#include "CodingDlg4.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

HBITMAP bg,bmp;
HDC hdc, mdc, bufdc;
int width,height;
CButton cb3,cb4,cb5;

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
CAboutDlg();

// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEasyCodingDlg dialog

CEasyCodingDlg::CEasyCodingDlg(CWnd* pParent /*=NULL*/)
: CDialog(CEasyCodingDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CEasyCodingDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CEasyCodingDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEasyCodingDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CEasyCodingDlg, CDialog)
//{{AFX_MSG_MAP(CEasyCodingDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(100,OnCoding1)
ON_BN_CLICKED(101,OnCoding2)
ON_BN_CLICKED(102,OnCoding3)
ON_BN_CLICKED(103,OnCoding4)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEasyCodingDlg message handlers

BOOL CEasyCodingDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here

SetWindowText(_T("Coding"));

// ,
int cxScreen = ::GetSystemMetrics(SM_CXSCREEN);
int cyScreen = ::GetSystemMetrics(SM_CYSCREEN);

int nEllipseWidth = cxScreen/2;
int nEllipseHeight = cyScreen/2;
width = nEllipseWidth;
height = nEllipseHeight;

// nEllipseWidth, nEllipseHeight
MoveWindow(nEllipseWidth/2,nEllipseHeight/2,nEllipseWidth,nEllipseHeight);

//
m_rgnWnd.CreateRoundRectRgn(0,0,nEllipseWidth,nEllipseHeight,50,50);

// m_rgnWnd
SetWindowRgn((HRGN)m_rgnWnd,TRUE);

//DC
hdc = (HDC)*(GetDC());
mdc = CreateCompatibleDC(hdc);
bufdc = CreateCompatibleDC(hdc);

bmp = CreateCompatibleBitmap(hdc,800,600);
SelectObject(mdc,bmp);

bg = (HBITMAP)LoadImage(NULL,"res/bg.bmp",IMAGE_BITMAP,800,600,LR_LOADFROMFILE);

bw = 100;
bh = 50;
CRect rect(20,20,20+bw,20+bh);
//
cb1.Create("Caesar ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,rect,this,100);
rect.left+=120;
rect.right+=120;
cb2.Create(" ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,rect,this,101);
rect.left+=120;
rect.right+=120;
cb3.Create("playfair ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,rect,this,102);
rect.left+=120;
rect.right+=120;
cb4.Create("Hill ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,rect,this,103);
rect.left+=120;
rect.right+=120;
cb5.Create("playfair ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,rect,this,104);
rect.left   = 20;
rect.right  = 120;
rect.top    += 65;
rect.bottom += 65;

return TRUE;  // return TRUE  unless you set the focus to a control
}

void CEasyCodingDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CEasyCodingDlg::OnPaint() 
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
MyPaint(hdc);
// TextOut(hdc,100,100," ",strlen(" "));
CDialog::OnPaint();
}
}

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CEasyCodingDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}

void CEasyCodingDlg::MyPaint(HDC hdc)
{
SelectObject(bufdc,bg);
BitBlt(mdc,0,0,800,600,bufdc,0,0,SRCCOPY);

StretchBlt(hdc,0,0,width,height,mdc,0,0,800,600,SRCCOPY);

}

void CEasyCodingDlg::OnCoding1()
{
OnOK();
CCodingDlg1 dlg;
dlg.DoModal();
}

void CEasyCodingDlg::OnCoding2()
{
OnOK();
CCodingDlg2 dlg;
dlg.DoModal();
}

void CEasyCodingDlg::OnCoding3()
{
OnOK();
CCodingDlg3 dlg;
dlg.DoModal();
}

void CEasyCodingDlg::OnCoding4()
{
OnOK();
CCodingDlg4 dlg;
dlg.DoModal();
}
yuer894617948
2007-12-19 13:56:26
sub-dialog CCodingDlg1.h ( sub- dialog mode is basically the same , just some of the variables and the use of algorithms, and therefore only instance in which a )

class CCodingDlg1 : public CDialog
{
// Construction
public:
CCodingDlg1(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
//{{AFX_DATA(CCodingDlg1)
enum { IDD = IDD_CODING_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA


// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCodingDlg1)
protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:

// Generated message map functions
//{{AFX_MSG(CCodingDlg1)
virtual BOOL OnInitDialog();
afx_msg void OnReturn();
afx_msg void OnDecode();
afx_msg void OnCoding();
afx_msg void OnSubmission();
afx_msg void OntCoding();
afx_msg void OnHelp();
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CButton m_bReturn;   //
CButton m_help;      //
CButton m_bDecode;   //
bool m_bd;
CButton m_bCoding;   //  
bool m_bc;

CEdit m_text;        //
CEdit m_eLoc;       //
CString m_sLoc;     // edit
CButton m_bApply;    //
CButton m_tCoding;   //

CString m_str;    //
int m_key;        //
int m_state;      // (0 ,1 ,2 )
};
saiyaren1
2007-12-19 14:09:57
code written fairly neat
but the variable name is too simple since
detailed report about what is wrong with it
debug or check the call stack
kissguigui
2007-12-19 14:26:11
halo ...... a continuous recovery can only go back three times ...... and a limited number of words in reply ...... so ...... I waited ......

sub- dialog CCodingDlg1.cpp

// CodingDlg1.cpp : implementation file
//

#include "stdafx.h"
#include "EasyCoding.h"
#include "CodingDlg1.h"

#include "EasyCodingDlg.h"
#include "CodeFunctions.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/*********************************************************
     100
 101
        110
      111
 102
  
*********************************************************/

/////////////////////////////////////////////////////////////////////////////
// CCodingDlg1 dialog

CCodingDlg1::CCodingDlg1(CWnd* pParent /*=NULL*/)
: CDialog(CCodingDlg1::IDD, pParent)
{
//{{AFX_DATA_INIT(CCodingDlg1)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}


void CCodingDlg1::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCodingDlg1)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCodingDlg1, CDialog)
//{{AFX_MSG_MAP(CCodingDlg1)
ON_BN_CLICKED(100,OnReturn)
ON_BN_CLICKED(101,OnDecode)
ON_BN_CLICKED(102,OnCoding)
ON_BN_CLICKED(103,OnHelp)
ON_BN_CLICKED(111,OnSubmission)
ON_BN_CLICKED(121,OntCoding)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCodingDlg1 message handlers

BOOL CCodingDlg1::OnInitDialog() 
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
// ,
int cxScreen = ::GetSystemMetrics(SM_CXSCREEN);
int cyScreen = ::GetSystemMetrics(SM_CYSCREEN);

//
int w = cxScreen/2;
int h = cyScreen/2;

// ,
MoveWindow(w/2,h/2,w,h,true);
SetWindowText("Caesar ");

//
m_bReturn.Create(" ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(550,280,650,330),this,100);
m_bDecode.Create(" ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(220,10,310,60),this,101);
m_bCoding.Create(" ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(320,10,410,60),this,102);
m_help.Create(" ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(10,10,100,60),this,103);

m_bd = 0;   //
m_bc = 0;   //
m_sLoc = "res/1.txt";
m_state = 0;

return TRUE;  // return TRUE unless you set the focus to a control
              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCodingDlg1::OnReturn()
{
OnOK();
CEasyCodingDlg dlg;
dlg.DoModal();
}

void CCodingDlg1::OnDecode()
{
int tx,ty;
char str[100];
int  n;
srand(GetTickCount());
n = rand()%TEXTNUM+1;     // n
CString bufstr,codestr;

// ,
FILE *fp;
if(!(fp = fopen("res/text.txt","r")) )
return;

//
while(n>0)
{
fscanf(fp,"%s",str);  //
n--;
}
//
fclose(fp);
m_str = str;

//
m_key = rand()%26;
// m_str ,
::CaesarCoding(m_str, codestr,m_key);

CDC *pDC = GetDC();

//
if(m_bc)
{
m_eLoc.ShowWindow(SW_HIDE);
m_tCoding.ShowWindow(SW_HIDE);
}

tx = 150;
ty = 80;
//
pDC->TextOut(tx,ty,"                                                                                 ");
ty+=30;
pDC->TextOut(tx,ty,"                                                                                 ");
ty+=30;
pDC->TextOut(tx,ty,"                                                                                 ");
ty+=30;
pDC->TextOut(tx,ty,"                                                                                 ");
ty+=30;
pDC->TextOut(tx,ty,"                                                                                 ");
pDC->TextOut(150,280,"                                                                                 ");
ty+=30;

tx = 150;
ty = 80;
//
bufstr = " :"+codestr+"                           ";
pDC->TextOut(tx,ty,bufstr);
ty+=30;

//
bufstr.Format(" :%d",m_key);
pDC->TextOut(tx,ty,bufstr);
ty+=30;

//
pDC->TextOut(tx,ty," :");
ty+=30;
if(!m_bd)
{
//
//
m_text.Create(WS_CHILD | WS_VISIBLE,CRect(tx,ty,tx+300,ty+15),this,110);
ty+=60;

//
m_bApply.Create(" ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(tx+100,ty,tx+200,ty+25),this,111);

m_bd = true;
} else {
m_text.ShowWindow(SW_SHOW);
m_bApply.ShowWindow(SW_SHOW);
}

ReleaseDC(pDC);
}

void CCodingDlg1::OnCoding()
{
int tx,ty;
char str[30];
int  n;
srand(GetTickCount());
n = rand()%TEXTNUM+1;     // n
CString bufstr,codestr;

//
if(m_bd)
{
m_text.ShowWindow(SW_HIDE);
m_bApply.ShowWindow(SW_HIDE);
}

CDC *pDC = GetDC();

tx = 150;
ty = 80;
//
pDC->TextOut(tx,ty,"******************************************************");
ty+=30;
pDC->TextOut(tx,ty,"******************************************************");
ty+=30;
pDC->TextOut(tx,ty,"                                                                                 ");
ty+=30;
pDC->TextOut(tx,ty,"                                                                                 ");
ty+=30;
pDC->TextOut(tx,ty,"                                                                                 ");
pDC->TextOut(150,280,"                                                                                 ");

tx = 150;
ty = 80;
ty+=60;
pDC->TextOut(tx,ty," txt :");
ty+=30;

if(!m_bc)
{
m_eLoc.Create(WS_CHILD | WS_VISIBLE,CRect(tx,ty,tx+300,ty+15),this,120);
GetDlgItem(120)->SetWindowText(m_sLoc);
ty+=60;

m_tCoding.Create(" ",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(tx+100,ty,tx+200,ty+25),this,121);
m_bc = true;
ty-=60;
} else {
m_eLoc.ShowWindow(SW_SHOW);
m_tCoding.ShowWindow(SW_SHOW);
}
ReleaseDC(pDC);

}

void CCodingDlg1::OnSubmission()
{
CString str;
GetDlgItem(110)->GetWindowText(str);

CDC *pDC = GetDC();
if(::IsMatching(m_str,str))
{
//
m_state = 1;
pDC->TextOut(150,280,"                          !!!                          ");
} else {
//
m_state = 2;
pDC->TextOut(150,280,"                          ……                            ");
}
ReleaseDC(pDC);
}

void CCodingDlg1::OnPaint() 
{
CPaintDC dc(this); // device context for painting

// TODO: Add your message handler code here
// Do not call CDialog::OnPaint() for painting messages
}

void CCodingDlg1::OntCoding()
{
FILE *fp1,*fp2;
CString loc,codestr;
int tx,ty;
GetDlgItem(120)->GetWindowText(loc);

CDC*pDC = GetDC();
// 1
if(!(fp1 = fopen(loc,"r")) )
{
pDC->TextOut(150,280,"                  !!!                  ");
return;
}
fscanf(fp1,"%s",m_str);
fclose(fp1);

//
srand(GetTickCount());
m_key = rand()%26;
::CaesarCoding(m_str,codestr,m_key);

// 2
if(!(fp2 = fopen("res/2.txt","w")) )
{
pDC->TextOut(150,280,"                       !!!                       ");
return;
}
fprintf(fp2,"%s",codestr);
fprintf(fp2,"\n %d",m_key);
fclose(fp2);

//
tx = 150;
ty = 80;
ty+=120;
pDC->TextOut(tx,ty," : /res/2.txt");
pDC->TextOut(150,280,"                       !!!                       ");
ReleaseDC(pDC);
}


void CCodingDlg1::OnHelp()
{
ShellExecute(NULL, NULL, "caesarcode.txt", NULL,NULL, SW_SHOWNORMAL); 
}


upstairs friends:
1. mentioned why not just add a button and use the code , that on the one hand I want to be familiar with the underlying mechanism of a button on the other hand the Add button , then use the code to the button layout and modifications will feel convenient and I have also appeared before the time to add buttons or other controls directly similar questions: multiple add a control error occurs. Of course, I add the control system established dialog is the main dialog , because the system does not know whether there are any restrictions on the establishment and the number of controls ......
2. about ID conflicts , I'm different sub- dialog indeed use the same ID, but in only one created buttons and button 2 and the two buttons when the corresponding sub- dialog connection has been achieved , and without any problems.
4. Thank you for your enthusiasm and ideas !
axuanxuan1
2007-12-19 14:43:38
should be said that not being given that an application will prompt dialog stop working , not the compiler runtime error
title is EasyCoding   Mecrosoft Foundation Classes application
content is:
EasyCoding   Microsoft   foundation Classes application   has stopped working
Windows  
can check online for solutions to this problem - " check online solution and close the program
-" Close the program
- after details

" debugger
see if the problem is and I added a button to the global variables , sub-dialog when clicking the back button will pop up a error dialog
specific content :
upper left corner there is a big difference between the number, the error contents are :
Debug   Assertion   Failed

Program:! .. school \ individual design \ cryptography \ EasyCoding1.4Hill password \ Debug \ EasyCoding.exe
File: wincore.cpp
Line: 639

For   infomation   on   how   your   program   can   cause   an   assertion
failure,   see   the   Visual   C ++   documentation   on  . asserts

(Press   Retry   to   debug   the   application)
then the lower right corner is   Abort, Retry , ignore   three buttons
youtedian
2007-12-19 14:57:17
point and then retry the program should be broken down
this time the call stack
position to check their own code to analyze the reasons
nokian781
2007-12-19 14:59:59
direct Add button or better, with the code is very easy to miss something.
if it is unable to find where the problem , then you add your own button to see the automatically generated code and your own code any different handwriting .