Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CDialog

Posted on 1998-06-10
6
Medium Priority
?
569 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 200 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
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

927 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