Monday, 4 March 2013

most modern computers


·  The only remaining problem is that most modern computers run so fast that the beeps
are continuous and sound like one beep. One way to solve this problem is to give the
processor another task to slow it down. Add an edit box, right click to Properties and
deselect Visible. Use ClassWizard to add a variable called pause of type long. Now add
the following code to OnClickBeepctrl1(), using a For loop to display value of pause to
the invisible edit box to slow the computer down, add code to limit the user to an integer
between 1 and 10 and set the edit box back to zero for next use.
void CbeeperDlg::OnClickBeepctrl1()
{
UpdateData(true);
while ((counter > 0) && (counter < 11))
m_beeper.Beep();
counter--;
for (int pause = 0; pause<=20000; pause++) UpdateData(false);
}
counter = 0;
UpdateData(false);
}
·  Build and run your program.

No comments:

Post a Comment