Solved

CDialog

Posted on 1998-06-10
6
558 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

13 Experts available now in Live!

Get 1:1 Help Now