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
Solved

CDialog

Posted on 1998-06-10
6
563 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

839 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