Solved

File Transfer Monitor Dialog

Posted on 2003-10-30
6
187 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

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

18 Experts available now in Live!

Get 1:1 Help Now