Message Box problem
-
Hi, I am using AfxMessageBox() API in my application.Sometimes the message box doesn't come up and when I debugged and saw found that the return value is 0 which means that there is no enough memory to display the message box.What do I do to solve this problem? Thank You. Yamuna.E. Yamuna.E.
-
Hi, I am using AfxMessageBox() API in my application.Sometimes the message box doesn't come up and when I debugged and saw found that the return value is 0 which means that there is no enough memory to display the message box.What do I do to solve this problem? Thank You. Yamuna.E. Yamuna.E.
Buy more RAM ? I've NEVER had AfxMessageBox fail, what makes you think it's memory related ? When does it happen ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?! - Jon Hulatt, 22/3/2002
-
Buy more RAM ? I've NEVER had AfxMessageBox fail, what makes you think it's memory related ? When does it happen ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?! - Jon Hulatt, 22/3/2002
Even for me this is the first time AfxMessageBox fails. MSDN tells that AfxMessageBox on failure returns 0 and that it is due to no enough memory. I forgot to mention the scenario. This messagebox I call from within a thread function(via CreateThread) which takes as its parameter the string to be displayed and I am sure there is no problem with string passing.This I made sure by hard-coding the string just to check whether it works fine with hard-coded string value.But even in that case I got the same problem. But now I tried using MessageBox API instead of AfxMessageBox.Its working fine.But couldn't get the reason behind the problem. Thank You. Yamuna.E. Yamuna.E.
-
Even for me this is the first time AfxMessageBox fails. MSDN tells that AfxMessageBox on failure returns 0 and that it is due to no enough memory. I forgot to mention the scenario. This messagebox I call from within a thread function(via CreateThread) which takes as its parameter the string to be displayed and I am sure there is no problem with string passing.This I made sure by hard-coding the string just to check whether it works fine with hard-coded string value.But even in that case I got the same problem. But now I tried using MessageBox API instead of AfxMessageBox.Its working fine.But couldn't get the reason behind the problem. Thank You. Yamuna.E. Yamuna.E.
It's certainly an odd problem. In the future, TRACE or OutputDebugString will allow you to check a variable value in Debug mode without having to bring up a dialog. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?! - Jon Hulatt, 22/3/2002
-
It's certainly an odd problem. In the future, TRACE or OutputDebugString will allow you to check a variable value in Debug mode without having to bring up a dialog. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?! - Jon Hulatt, 22/3/2002