Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-02-17
2
Medium Priority
?
345 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 2000 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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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…

618 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