Hi;
I am new to MFC applications and working on a MCQ based game in Visual C++ using MFC. I have a small question to ask, if I click the option (a-d) that is correct, the game increases score and displays msg "correct' , but I am not able to make it show the correct option if a user selects an incorrect option. like a mesbox showing "Incorrect. Correct op is A".
Here is my code for correct option selection.
void CI2T::IsCorrect(CString s)
{
KillTimer(0);
m_time.SetWindowTextA("30");
if(s == correct)
{
score++;
MessageBox("CORRECT");
CString s;
s.Format("%d",score);
m_score.SetWindowTextA(s);
}
else
MessageBox("INCORRECT");
}
The code for option selection is here. same for options a-d
void CI2T::OnBnClickedI2tOpta()
{
if(!end)
{
IsCorrect(opA);
m_OptA.SetCheck(0);
if(Check())
Rungame();
}
}
Also, the game time is being maintained, is it possible that I can kill timer during the game, e.g. I have started the game and somebody interrupts me for say 30 sec, once I come back to game, the question has passed. Can I use some keystroke to pause the game at that state and resume it again with the same keystroke when I am ready to play it again.
I'll appreciate any help or suggestions in this regard.