المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to make MessageBox () to behave as AfxMessageBox ();



C++ Programming
04-06-2009, 09:22 AM
Hai!
I have an MFC application in which if i press a button, a message box pops up. In that message box i have to display the Error message and caption so i am using MessageBox () instead of AfxMessageBox () since in AfxMessageBox () i cannot specify the caption.
Now the problem with MessageBox () is for as many times I press the button that many time the message box pops up, but if i use AfxMessage box it pops up once unless i respond to it i am not able to press the button in the main dialog.

So i need in this format i want to display the error message, its caption but unless user responds to that message box i must not be able to press the button as it happens in AfxMessageBox ().
I tried with the following, but still multiple messagebox pops up if i continously press the button in main dialog
MessageBox ("This error is due to XYZ", "Error", MB_ICONERROR | MB_APPLMODAL);

Thanks!