Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

The Ultimate Toolbox Net Browse Tree Control

0.00/5 (No votes)
25 Aug 2007 1  
A network browse tree control from the Ultimate Toolbox

Visit the Ultimate Toolbox main page for an overview and configuration guide to the Ultimate Toolbox library.

Source code and project files for this sample can be found in the samples\gui\NetBrowse directory of the sample projects download.

Overview

The COXNetBrowseTree control class allows a user to select a certain type of resource up to a certain level (net - domain - server - disk, printer, other).

The class COXNetBrowseTree is derived from the MFC class CTreeCtrl. It uses the tree control to show a hierarchical view of the network resources. The control itself knows how to retrieve the network resource information to show it to the user.

All this is done automatically and only when the user requests this information. Because retrieving the network information for a particular resource may require some time, the information is only fetched when the user actually expands a branch of the tree.

Features

  • Easy to use in your dialog (just subclass a tree control).
  • All standard notification messages are available (e.g. TVN_SELCHANGED).
  • Easily browse resources on the network.
  • Show a resource only up to a certain level: (net - domain - server - disks, printers, others).
  • Easily recognizable resource icons included.
  • Extra info for each resource is maintained (type, display type, local name, remote name, comment and provider).

The compiled HTML help documentation contains a complete class reference for COXNetBrowseTree.

Usage

Since COXNetBrowseTree is derived from CTreeCtrl, using it is as simple as subclassing a CComboBox member variable set by the Class Wizard by simply replacing the class name in the declaration in the AFX_DATA area of your CDialog derived class. Include the OXNetBrowseTree.cpp file in your project and:

#include "OXNetBrowseTree.h"



class CNetBrowseDlg : public CDialog
{
// Data members -------------------------------------------------------------


public:
    //{{AFX_DATA(CNetBrowseDlg)


    enum { IDD = IDD_NETBROWSE_DIALOG };
    ...
    COXNetBrowseTree    m_wndNetBrowseTree;
    ...

History

Initial CodeProject release August 2007.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here