-
MFC function
Code:
int ga, gb; //global variable
void CSortingDlg::Onbutton1()
{
m_intA = ga;
m_intB = gb;
.
.
.
}
void CSortingDlg::Onbutton2()
{
int a, b;
a = ga;
b = gb;
if ( ( a == 0 ) || ( b == 0 ) )
{
MessageBox ( "Please enter a and b 1st.", "Error.", MB_ICONSTOP);
.
.
.
}
Is there any way to jump back to function onbutton1() to read in a and b again before going down to onbutton2 function?
-
pardon?
OnButton1()
or
SendMessage() with a WM_COMMAND and BN_CLICKED
-
I use MFC, onbutton1 is the function of button1 and BN_CLICKED.
-
Put all the code from Onbutton1() you need to use (when Onbutton2() is called) in ANOTHER member function.
When Onbutton1() is called, call this member function.
When Onbutton2() is called, call this member function then continue.