Why might ProcessMessages throw a C++ Exception? -


while maintaining old product, came across error results in screen being filled hundreds of message boxes saying 'c++ exception' , nothing else. traced problem following line:

application->processmessages(); 

i understand purpose of line, process messages in message queue, i'm not sure what's causing error.

i'm not looking specific solution, i'm wondering if else has had problem or might know sort of situations may cause happen.

closing message boxes causes application return normal, expected behavior.

update - after more searching, found errors not fault of processmessages. errors occur because program doing intensive calculations , runs out of memory. seems commenting out processmessages reduces memory consumption enough through calculations without errors. hence, processmessages looks culprit, in fact, not.

it looks have refactoring do.

update 2 - 3 days later, have come conclusion error happens when processmessages called. if comment calls processmessages (and dismay, there many), application runs fine constant memory consumption, implying intensive calculations not sucking memory. uncommenting call causes memory skyrocket point of error again. original question stands: why processmessages cause error?

it appear calls made timer event , others made main application execution. might problem?

it sounds application error in library's message-processing code catch-all exception handler shows generic message using win32 ::messagebox() api in response. string "c++ exception" in code , see if in catch(...), catch (std::exception&) or similar handler. it's possible using win32 unhandled exception filter instead.

preferably, should run program under visual studio debugger debug->exceptions dialog set catch c++ exceptions when they're thrown rather if unhandled. way you'll find site(s) generating exception immediately.

if can't run under debugger, may have customize unhandled exception handler __line__ , __file__ c macros can @ least find out method generating error. switch displaying message box win32's outputdebugstring() api , use tool debugview watch debugging strings.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -