-
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
-
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.
-
Re: More Events
GREAT!!!
It works!!!
1000 times Tanks :)
-
Re: More Events