
Automatic dialog box refreshing
Simplest thing I can think of, if I understood you correctly, is to
provide your own OnShow event handler (in your myDialog class). Check
that bShow is true (dialog is being displayed).
Create a timer in your dialog at this point (SetTimer(...)) (possibly
with an initial delay to give the dialog time to display). To handle
the timer you need write an OnTimer event handler (for your myDialog
class) and check for your timer's ID and then keep updating your
display when the timer fires. Don't forget to call KillTimer(ID) when
the last element has been displayed.
Hope this helps.
--Martin
Quote:
> Thanks for your answer, but I tried your solution and it
> didn't work. I got the same result: Only the last string
> is displayed. This behavior accords with the MFC wizard
> that indicates "Sent to a ialog box before thealog box is
> displayed". So I think this callback is not appropriate.
> Did I done wrong ?
> Is there another solution ?
> Guillaume.
> >-----Original Message-----
> >The best place is at the end of the OnInitDialog
> handler. You can add this
> >handler using the MFC Wizard.
> >Good luck !
> >> I'm not very used to MFC and this problem drived me
> crazy
> >> during the whole week-end... please you MFC gurus, help
> >> me !
> >> My app is a dialog box which calls another dialog box
> >> ("myDialog") with the following command :
> >> myDialog.DoModal();
> >> Once "myDialog" is displayed I want it to display some
> >> strings that are in an array (let say 10 elements), but
> >> one string every second. My problem is I don't know
> when
> >> to start my refresh loop.
> >> How do I know that the dialog box is ready ? Can't find
> >> the appropriate WM message.
> >> I thought I could respond to some WM_IDLE, but I can't
> >> find such messages for a DialogBox.
> >> I tried WM_PAINT, but as I supposed, display occurs
> only
> >> when the whole array is parsed and therefore, only the
> >> last string is displayed after 10 seconds.
> >> I also tried to start refreshing after the user
> clicked on
> >> some button, it worked fine because I had the callback
> >> On_ButtonCLick in which I could put my refresh loop.
> >> But I want the refreshing to start as soon as the
> dialog
> >> is shown. What callback or WM message should I respond
> to ?
> >> Thanks for your help,
> >> Guillaume.
> >.