Click here to Skip to main content
11,932,446 members (48,785 online)
Click here to Skip to main content
Add your own
alternative version


40 bookmarked


, 16 Oct 2000
Rate this:
Please Sign up or sign in to vote.
A CWaitingTreeCtrl-derived class to display network resources.

Sample Image - sample.gif


This is just an example of a content provider class (see the article CWaitingTreeCtrl), which overrides the PopulateItem virtual function to show network resources only when the user wants to access them.

You may specify the network resource to be used as the root of the tree control, as well as what kind of resources to be shown in the last level. You may also get specific information about the network resource associated with an existing item. To communicate with the class you can use the standard NETRESOURCE structure and related flags.

User interface features are those offered by the base class and can be further personalized with custom animations.

Class Reference

BOOL RefreshNetworkRoot(LPNETRESOURCE pRoot, DWORD dwStopAtDisplayType =

It associates a network resource with the root item and refreshes the tree items in the first level. It also sets what kind of container resources must not be further enumerated.

The first argument pRoot is the address of the network resource you want as the root of the tree control. A value of NULL means the network root.

The dwStopAtDisplayType argument could take the same values as the dwDisplayType field of the NETRESOURCE structure. It specifies the last level of network resources that will be visible in the tree control.

The return value is TRUE if you specified a valid resource, FALSE otherwise.


It retrieves the network resource associated to the specified item. If successful, the return value is TRUE and the structure pointed by pNr contains valid data, otherwise the return value is FALSE.


[ Today ]
  • Initial public release.


Please note that this class is not fully functional. So far, it can be used only in a dialog, but I will work on it when I have more time. I released this version to provide an example of a content provider for my CWaitingTreeCtrl class (see the article).

Any help or suggestion would be greatly appreciated. I plan to use this control in a new version of our NetSend utility, see this. Also, the latest beta releases of this class could be found here, for test only purpose.


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


About the Author

Paolo Messina
Technical Lead RoboTech srl
Italy Italy
Paolo began programming at the age of 9 with a glorious Olivetti M24 (i8086) and GW-BASIC, then he played a bit with Turbo C, Turbo Pascal and Assembly (using the MS-DOS Debug). Quick BASIC and Visual Basic shortly followed, until he learned C++ in College. He tought himself MFC and Windows programming, along with some DHTML and Javascript.

Always attracted by low-level programming and Assembly, he started to appreciate the joys of templates and STL while working for his Master Thesis. For seven months he was playing with airplanes and automatic control at the Unversity of Illinois at Urbana-Champaign, where he first met QNX and embedded systems.

At work he learned Java to develop user interfaces and graphical editors, and re-discovered the Eclipse IDE that he had used in its early versions with the QNX SDK. There he also deepened his knowledge of Linux and embedded systems, microcontrollers firmware and embedded voice recognition, while also practicing electronics design.

He graduated in Computer Engineering (Ingegneria informatica) at the University of Pisa, Italy, in December 2003. Currently working for an edutainment robotics company (

He lives in Peccioli (Pisa) and Follonica (GR), Italy.

You may also be interested in...

Comments and Discussions

GeneralMulti Select Implemented Pin
Arun Yodyana9-Jun-06 11:02
memberArun Yodyana9-Jun-06 11:02 
GeneralNetwork event Pin
Fred_12331-Aug-04 1:19
memberFred_12331-Aug-04 1:19 
GeneralRe: Network event Pin
Paolo Messina31-Aug-04 2:06
memberPaolo Messina31-Aug-04 2:06 
Generalc++ Pin
ziamustafa18-Jul-03 11:12
sussziamustafa18-Jul-03 11:12 
GeneralExcuse Me Pin
FoolBear3-Jan-03 23:53
sussFoolBear3-Jan-03 23:53 
GeneralRe: Excuse Me Pin
Paolo Messina4-Jan-03 1:35
memberPaolo Messina4-Jan-03 1:35 
GeneralRe: Excuse Me Pin
Anonymous5-Jan-03 22:36
sussAnonymous5-Jan-03 22:36 
GeneralNetwork resources Pin
Theron21-Jun-02 10:35
memberTheron21-Jun-02 10:35 
GeneralRe: Network resources Pin
Paolo Messina4-Aug-02 14:00
memberPaolo Messina4-Aug-02 14:00 
GeneralAnimation problem Pin
f0tisx27-May-02 23:08
memberf0tisx27-May-02 23:08 
GeneralRe: Animation problem Pin
Paolo Messina28-May-02 8:27
memberPaolo Messina28-May-02 8:27 
GeneralRe: Animation problem Pin
f0tisx28-May-02 21:05
memberf0tisx28-May-02 21:05 
I derived a control from CHourglassNetworkTreeCtrl and placed it in
a docking window. The problem with the animation was that I was
getting a NULL pointer in the m_hAniCur member of the CHourglassFX()
class. After replacing the LoadImage function I finally managed to get
it working. If you have any alternatives I'll be happy to hear it.

Another thing I've noticed is that SetAnimationDelay() dependes heavily
on the cursor frame jiffies.Am I wrong ?

Anyway, your work is work very good and I appreciate the quick response.

Another thing. I've seen that your code is free for non-commercial use.
What about modifications and commercial use.


GeneralRe: Animation problem Pin
Paolo Messina28-May-02 23:33
memberPaolo Messina28-May-02 23:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 17 Oct 2000
Article Copyright 2000 by Paolo Messina
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid