Solved

CDialog

Posted on 1998-06-10
6
559 Views
Last Modified: 2013-12-03
Currently, I create a CDialog derived class called CFileTRDialog, this dialog supposed to show the status
when I do some file transfer.

I have function like SetPercentageSent, SetFilesSent that I can call from other class which made use of the
dialog to feedback to it. So that the dialog can keep on updating the necessary info. Of course, there's also a
progress bar.

From the other class that made use of the CFileTRDialog, I created an object of it. So, whether I make it a
modal or modeless... it doesn't refresh refresh my input. For Modal, it definitely couldn't work as the data can
only be passed to the dialog when it's dismissed. For modeless, it doesn't refresh the data, irregardless of
how long the file transfer would take.

I traced through the code for updating the information in the CFileTRDialog and indeed it does update but it
doesn't show it those text fields.. I tried all ways..

AString = "something new";
UpdateData(FALSE);

SetDlgItemText(ID, "something new");

I supposed the graphics do not have time to update during IO, because when I put a AfxMessageBox("")
after one of the UpdateDate(FALSE). The dialog has no choice but to stop receiving data and maybe has
time to repaint the GUI. I thought of spawning a thread but do not know which function to make it a thread
function. Another alternative would be to throw all the sending and receiving into the dialog class which is not
very elegant way of programming.
0
Comment
Question by:poisson68
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:vvk
ID: 1407506
Try to execute RedrawWindow if want to update only specific region or UpdateWindow to redraw client area.
0
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1407507
There is an article in Microsoft Systems Journal February 1997 Vol 12 No 2 Wicked Code. It handles exactly the same case. It implements a CWaitDialog class. Go to http://www.microsoft.com/msj to download the source code.
0
 

Author Comment

by:poisson68
ID: 1407508
chensu, the link to the Wicked Code is not available anymore, do you still know where to find it...? thanx
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:poisson68
ID: 1407509
chensu, the link to the Wicked Code is not available anymore, do you still know where to find it...? thanx
0
 
LVL 23

Expert Comment

by:chensu
ID: 1407510
The article is not available on line. You can download the source code (http://www.microsoft.com/msj/code1993to1997/MSJFEB97.EXE). The source code is easy to understand and comes with a demo program.
0
 

Author Comment

by:poisson68
ID: 1407511
I've managed to make it work b4 I see you reply...thanx for you suggestion on RedrawWindow
I later accidentally found out that UpdateWindow worked... thanx for the pointers...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now