?
Solved

File Transfer Monitor Dialog

Posted on 2003-10-30
6
Medium Priority
?
235 Views
Last Modified: 2013-11-20
I have a new idea for my program. To give a background, it has an MDI where each document represents a connection to a server. I am thinking about making a single window to monitor downloads from the servers so there isn't a window for every download. I plan to do this by using a CListCtrl and drawing a progress bar where the last column of a line is. The OnTimer() of the dialog will cycle through all documents looking for active downloads via a list kept of them in the document and display them in this list. Correct me if I am wrong but, I am thinking that the dialog should be a member of the MainFrame. Because it has to go through all the active documents. Am I correct in assuming this approach? Any suggestions are welcome. Thank you.

0
Comment
Question by:SGyves
[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
  • 3
6 Comments
 

Author Comment

by:SGyves
ID: 9654397
Also...how do you cycle through open documents via the frame????
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 1400 total points
ID: 9655494

>> how do you cycle through open documents via the frame????

      CWinApp* pApp = AfxGetApp();

      POSITION pos = pApp->GetFirstDocTemplatePosition();

      while (pos)
      {
            CDocTemplate* pTemplate = (CDocTemplate*)pApp->GetNextDocTemplate(pos);
            POSITION pos2 = pTemplate->GetFirstDocPosition();
            while (pos2)
            {
                  CDocument * pDocument;
                  if ((pDocument=pTemplate->GetNextDoc(pos2)) != NULL)
                  {
                        POSITION posView = pDocument->GetFirstViewPosition();

                        // Here u get the view, add into array to keep the view pointer
                        CView* pView = pDocument->GetNextView(posView);
                  }
            }
      }


And your downloading progress:
Flashget software is also doing something like that.

Rosh :)
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9655524
And look at this link

http://www.codeproject.com/listctrl/xlistctrl.asp - XListCtrl - A custom-draw list control with subitem formatting

Rosh :)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:SGyves
ID: 9658687
Nice stuff to look at. I would probably like to get rid of the overhead of having all those CProgressCtrl's in my dialog. So drawing directly to the DC and filling in the subitem that way looks great. Thank you for your "to the point" answer.   :)   Always a pleasue giving you the points Rosh.

Stephen
0
 

Author Comment

by:SGyves
ID: 9659171
Hey...do you think I should keep a "master list of downloads" in the frame class or in the dialog itself?
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9665180
>> frame class or in the dialog itself?
frame class is better, set its pointer or reference to dialog for showing status
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month9 days, 8 hours left to enroll

762 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