Solved

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

Posted on 2011-02-17
2
322 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 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
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 use and create new code templates in NetBeans IDE 8.0 for Windows.

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now