|
-
November 3rd, 2010, 11:59 AM
#1
Application Hanging
I'm creating a Windows application using Microsoft Visual C++ 2008.
I successfully created a GUI and programmed all of its functionality. However, when I run certain functions my application will stop responding. The program will still be running nonetheless, and it will start responding once again as soon as it finishes the computational-intensive task.
How can I avoid this? I implemented a bar to show the computation's progress, but because of the window's non-responsiveness it won't even show up!
Thank you in advance for your help.
-
November 3rd, 2010, 12:09 PM
#2
Re: Application Hanging
Create a thread to do the computational-intensive task.
-
November 3rd, 2010, 12:12 PM
#3
Re: Application Hanging
You should move your computational-intensive task into a worker thread. This thread will then periodically notify the main GUI thread (using PostMessage) about the "progress" and the GUI thread will update its progress bar accordingly.
Read about worker thread in MSDN (http://msdn.microsoft.com/en-us/libr...60(VS.71).aspx) and in the Worker Threads essay
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|