-
April 14th, 2005, 09:08 AM
#1
More Events
Hi guys
I have got a simple application.
It is composed by a graphical objects that manages cartographical maps.
If I click on a toolbar button the program starts to read from a txt file.This allows to convert the content of the file into graphical operations on the map
This is the problem:
When the application runs and reads the file, I can't interact with the remaining of the application (for example I can not click another toolbar button) because the system is blocked until the reading of the file has not be finished
How can I solve this?
Thanks in advance
-
April 14th, 2005, 09:15 AM
#2
Re: More Events
solutions:
1. Insert the below function in the loop where you are processing the file:
Code:
void DoEvents()
{
MSG msg;
while ( PeekMessage ( &msg, NULL, 0, 0, PM_REMOVE ) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
2. Use a worker thread. This way you will not block the UI thread.
-
April 14th, 2005, 09:41 AM
#3
Re: More Events
GREAT!!!
It works!!!
1000 times Tanks
-
April 14th, 2005, 10:23 AM
#4
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
|