Solved

File Transfer Monitor Dialog

Posted on 2003-10-30
6
200 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
  • 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 350 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cat dog challenge 18 124
Excel Use VBA to get user's Mac Address for their computer 5 109
WinWaitActive parameters 12 31
sumHeights  challenge 17 65
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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

15 Experts available now in Live!

Get 1:1 Help Now