File Transfer Monitor Dialog

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.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SGyvesAuthor Commented: do you cycle through open documents via the frame????
Roshan DavisCommented:

>> 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 :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Roshan DavisCommented:
And look at this link - XListCtrl - A custom-draw list control with subitem formatting

Rosh :)
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

SGyvesAuthor Commented:
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.

SGyvesAuthor Commented: you think I should keep a "master list of downloads" in the frame class or in the dialog itself?
Roshan DavisCommented:
>> frame class or in the dialog itself?
frame class is better, set its pointer or reference to dialog for showing status
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.