Solved

Non pumping wait or processing a very long running operation in .net 2.0

Posted on 2011-02-17
2
334 Views
Last Modified: 2013-11-26
I have a .net app that keeps getting this error.  I am using a for/loop and that I know should run for about 1 min.  It works somtimes and other times I get this error.  This is a console application.  On a form I have used application.doevent() to fix this.  Any way I can fix this?
0
Comment
Question by:chadmanvb
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 34921652
You are doing a lengthy process inside of the main loop of you application. The main loop handles the management of your GUI, and when you do lengthy operations on this thread (remember that what seems short to you can be an eternity for a computer), you prevent the GUI from processing its messages (e.g. draw window, display text, move here, etc). You should be spawning a separate thread, using a BackgroundWorker, or using the ThreadPool to perform you lengthy operation. There are dozens of articles describing each option right here on EE.
0
 

Author Closing Comment

by:chadmanvb
ID: 34953592
I ended up just chaning it to a form appliction and adding the application.doevents.  I think the seperate process would have also worked.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question