Solved

CDialog

Posted on 1998-06-10
6
565 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

752 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