Click here to Skip to main content
15,867,453 members
Articles / Desktop Programming / MFC
Article

The Ultimate Toolbox Net Browse Tree Control

Rate me:
Please Sign up or sign in to vote.
4.20/5 (3 votes)
25 Aug 2007CPOL2 min read 32.5K   482   17  
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

Image 1

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:

C++
#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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Canada Canada
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.

Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.
This is a Organisation

476 members

Comments and Discussions

 
-- There are no messages in this forum --