• Narrow screen resolution
  • Wide screen resolution
  • Auto width resolution
  • Increase font size
  • Decrease font size
  • Default font size
  • default color
  • red color
  • green color

Got Good Credit ?

Saturday
Feb 11th
FireBoard
Welcome, Guest
Please Login or Register.    Lost Password?
italian prefixes Updating progress bar after OnInitDialog (0 viewing) 
Go to bottom Post Reply Favoured: 0
TOPIC: italian prefixes Updating progress bar after OnInitDialog
#61470
italian prefixes Updating progress bar after OnInitDialog  
Hi all, I have a dialog-box: when the user presses a button, I would like to show a new modal dialog-box with a progress bar indicating some potentially lengthy operation progress. This operation is done by a worker thread. (The worker thread sends messages to the GUI thread, to update progress bar position.) The problem is that I can't start the thread or send messages to the progress bar from OnInitDialog. So, I thought about this work-around : in OnInitDialog, I create a timer (just 200 ms), and return. When the timer ticks for the first time (i.e. after 200 ms since OnInitDialog returned), the OnTimer handler calls another member function of the dialog-box. This member function starts the worker thread, which can now send messages to GUI thread to update the progress bar (in fact, after OnInitDialog, the progress bar is ready to process messages). (KillTimer is immediately called to avoid new firing of timer events.) Everything is working fine. I just would like to know if there is any different solution to that problem, instead of using a one-shot timer to postpone beginning of work after OnInitDialog. Thanks, Giovanni
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#61471
David Wilkinson (Visitor)
Click here to see the profile of this user
Birthdate:
italian prefixes Updating progress bar after OnInitDialog  
Hi all, I have a dialog-box: when the user presses a button, I would like to show a new modal dialog-box with a progress bar indicating some potentially lengthy operation progress. This operation is done by a worker thread. (The worker thread sends messages to the GUI thread, to update progress bar position.) The problem is that I can't start the thread or send messages to the progress bar from OnInitDialog. So, I thought about this work-around : in OnInitDialog, I create a timer (just 200 ms), and return. When the timer ticks for the first time (i.e. after 200 ms since OnInitDialog returned), the OnTimer handler calls another member function of the dialog-box. This member function starts the worker thread, which can now send messages to GUI thread to update the progress bar (in fact, after OnInitDialog, the progress bar is ready to process messages). (KillTimer is immediately called to avoid new firing of timer events.) Everything is working fine. I just would like to know if there is any different solution to that problem, instead of using a one-shot timer to postpone beginning of work after OnInitDialog. Giovanni: I'm sure I'm missing something, but why can you not start the thread or send messages to the progress bar from OnInitDialog ? One-shot timer is a common technique for delaying some operation until after the dialog is displayed. Another is to use a custom PostMessage(). But if you are starting a thread, I don't see why you need it, because AfxMessageBox() return immediately. Is this because you have two _layer_s of modal dialogs?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#61472
italian prefixes Updating progress bar after OnInitDialog  
I'm sure I'm missing something, but why can you not start the thread or send messages to the progress bar from OnInitDialog ? One-shot timer is a common technique for delaying some operation until after the dialog is displayed. Another is to use a custom PostMessage(). But if you are starting a thread, I don't see why you need it, because AfxMessageBox() return immediately. Is this because you have two _layer_s of modal dialogs? David: I'm sorry. The problem was in another part of the code. I adjusted something else, and now I don't need to use a posticipating one-shot timer. (Multi-threaded programming is not trivial at all Giovanni
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#61473
David Wilkinson (Visitor)
Click here to see the profile of this user
Birthdate:
italian prefixes Updating progress bar after OnInitDialog  
David: I'm sorry. The problem was in another part of the code. I adjusted something else, and now I don't need to use a posticipating one-shot timer. (Multi-threaded programming is not trivial at all Giovanni Giovanni: posticipating ? Is that an Italian word? It's not English, AFAIK. I like it though...
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#61474
Tom Serface (Visitor)
Click here to see the profile of this user
Birthdate:
italian prefixes Updating progress bar after OnInitDialog  
David: I'm sorry. The problem was in another part of the code. I adjusted something else, and now I don't need to use a posticipating one-shot timer. (Multi-threaded programming is not trivial at all Giovanni Giovanni: posticipating ? Is that an Italian word? It's not English, AFAIK. I like it though...
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#61475
Tom Serface (Visitor)
Click here to see the profile of this user
Birthdate:
italian prefixes Updating progress bar after OnInitDialog  
I have a dialog-box: when the user presses a button, I would like to show a new modal dialog-box with a progress bar indicating some potentially lengthy operation progress. This operation is done by a worker thread. (The worker thread sends messages to the GUI thread, to update progress bar position.) The problem is that I can't start the thread or send messages to the progress bar from OnInitDialog. So, I thought about this work-around : in OnInitDialog, I create a timer (just 200 ms), and return. When the timer ticks for the first time (i.e. after 200 ms since OnInitDialog returned), the OnTimer handler calls another member function of the dialog-box. This member function starts the worker thread, which can now send messages to GUI thread to update the progress bar (in fact, after OnInitDialog, the progress bar is ready to process messages). (KillTimer is immediately called to avoid new firing of timer events.) Everything is working fine. I just would like to know if there is any different solution to that problem, instead of using a one-shot timer to postpone beginning of work after OnInitDialog. Thanks, Giovanni
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
 

Short News

Cache Directory Unwriteable


The record number of countries will be penalized for an excessive deficit

Tackling the crisis in the States absorbs a quantity of Asbestos utilization kanutouren IWC Replica Watch money that the situation in the budgets of countries is becoming increasingly tense. Sometimes you can even the impression that the authorities of the country completely lost control of the state of equilibrium in the public hand. Excessive deficit begins to consume more and more countries from the EU, the EC decided to take the steps to run against some of the excessive Holzhaus Villa For Sale In Motor City Tennis Live Scores Streaming deficit procedure.

Global economic crisis is increasingly beginning to impress their niechlubne influenced the condition of the public finance sector in the EU. The result is a deepening gap between the level of income and expenditure budgets of the member countries, and consequently further Englisch online lernen Posen Cheap flights increase their current debt.

Today the governments of many EU countries are becoming major problems in order to maintain the budget deficit in the toes and thus does not exceed the permissible limit of 3 percent. GDP, which was provided for in the Treaty of remortgage help Cool QSL Print Service house by the sea Maastricht. Unfortunately, it probably will be few of them. Do not respect the EU standards in this matter at the initial stage, may threaten the imposition of financial sanctions on the country, and then complete with money coming mostly from EU funds. NB the occurrence of excessive deficits in the Member States of the Community also raises issues associated with maintaining the overall level of its stability, and thus the credibility and in the china phone card plastics Mm Tower international arena.


Serwis korporacyjny
Serwis korporacyjny, Serwis korpor…
www.emarketingexper…
Sklep komputerowy
Sklep komputerowy
rampc.pl
Komiks
Komiks
www.netkomiksy.pl
LAMPY
Lampy i oświetlenie
www.laluna.pl
wczasy rewal
rewal, pokoje rewal
www.soluch.pl
Pozycjonowanie Fundacja Iskierka Niechciane i Zapomniane Podaruj Zycie Mam Marzenie Dzieci Niczyje