Solved

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

Posted on 2011-02-17
2
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

726 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