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
{
public:
enum { IDD = IDD_NETBROWSE_DIALOG };
...
COXNetBrowseTree m_wndNetBrowseTree;
...
Initial CodeProject release August 2007.