Click here to Skip to main content
Click here to Skip to main content

The Ultimate Toolbox Net Browse Tree Control

, 25 Aug 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
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 <span class="code-string">"OXNetBrowseTree.h"
</span>


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)

Share

About the Author

The Ultimate Toolbox
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.
Group type: Organisation

394 members


Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141220.1 | Last Updated 25 Aug 2007
Article Copyright 2007 by The Ultimate Toolbox
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid