Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 957709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:44:58+00:00 2026-05-16T00:44:58+00:00

While maintaining an old product, I came across an error that results in the

  • 0

While maintaining an old product, I came across an error that results in the screen being filled up with hundreds of message boxes saying ‘C++ Exception’ and nothing else. I traced the problem to the following line:

Application->ProcessMessages();

I understand the purpose of this line, to process all the messages in the message queue, but I’m not sure what’s causing the error.

I’m not looking for a specific solution, but I’m wondering if anyone else has had this problem or might know what sort of situations may cause this to happen.

Closing all the message boxes causes the application to return to normal, expected behavior.

Update – After some more searching, I found that the errors are not necessarily the fault of ProcessMessages. The errors occur because the program is doing some intensive calculations and actually runs out of memory. It seems like commenting out ProcessMessages reduces the memory consumption just enough to get through the calculations without errors. Hence, ProcessMessages looks like the culprit, but in fact, is not.

It looks like I have some refactoring to do.

Update 2 – Three days later, I have come to the conclusion that error only happens when ProcessMessages is called. If I comment all the calls to ProcessMessages (and to my dismay, there are many), then the application runs fine with a constant memory consumption, implying that the intensive calculations are not sucking up the memory. Uncommenting a call causes the memory to skyrocket to the point of error again. So the original question stands: why does ProcessMessages cause this error?

It would appear that some calls are made from a timer event and others are made from the main application execution. Might this be a problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:44:59+00:00Added an answer on May 16, 2026 at 12:44 am

    This is mostly a guess, but from what I see, it’s a problem caused by a large back log of messages. During the large computation, the application becomes unresponsive for number of seconds while a large number of messages are thrown on the queue (many of these are timer events). When the computation finishes and ProcessMessages is called, the application is overwhelmed with too many messages and dispatching them all causes a memory overflow. If I add ProcessMessages after every few iterations of the computation to dispatch events as they come, the memory consumption remains constant.

    Sound plausible?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're maintaining an old video game that uses a full-screen 256-color graphics mode with
Is there a way to have a custom error page while maintaining the HTTP
While maintaining some code, I discovered that we have an infinite hang-up in a
I have a console application that successfully re-sizes an image while maintaining aspect ratio.
What are the best practices and rules-of-thumb to follow while maintaining code? Is it
How can I rotate an Bitmap a given number of degrees while maintaining the
What I would like to do is use the elegance of LINQ while maintaining
I have been maintaining an installation for a while but I am not really
Is it possible to make a UITabBar look like a UIToolBar, while maintaining its
I need to maintain column names, and not allow duplicate entries, while maintaining the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.