I have made a MCQ based game in Visual C++ using MFC. It runs fine but it shuts down when some key is pressed unintentionally. Like, if you click the options with mouse click, it works fine but even if you press ENTER key during the game, it quits immediately. What could be the reason? Does it have anything to do with Keyboardstate declaration? If anybody had such experience, kindly share your solution.
That's a famous behavior of MFCs Close button -- the Close button is activated when the Enter key is pressed. One way to fix that is to catch the WM_CLOSE event and ignore it, but then you might not be able to close the program at all.
Another way is to catch the return key in OnTranslateMessage(). This is for CDialog, but you can do the same thing in any type of MFC program.
I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...
i am using visual studio 2015 and trying to export data which i am importing through excel by the user selected Excel file. Now the importing part has been successfully completed i am using OLEDB Connection but Stuck in exporting the same data to a new Excel file. tried ...