Click here to Skip to main content
Licence 
First Posted 16 Oct 2000
Views 107,647
Bookmarked 39 times

CNetworkTreeCtrl

By | 16 Oct 2000 | Article
A CWaitingTreeCtrl-derived class to display network resources.

Sample Image - sample.gif

CNetworkTreeCtrl

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

CNetworkTreeCtrl::RefreshNetworkRoot
BOOL RefreshNetworkRoot(LPNETRESOURCE pRoot, DWORD dwStopAtDisplayType =
                                                  RESOURCEDISPLAYTYPE_GENERIC)

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.

CNetworkTreeCtrl::GetItemResource
BOOL GetItemResource(HTREEITEM hItem, LPNETRESOURCE pNr)

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.

Updates

[ Today ]
  • Initial public release.

Conclusion

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.

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

About the Author

Paolo Messina

Software Developer
RoboTech srl
Italy Italy

Member

Paolo began programming at the age of 9 with a glorious 8086 and GW-BASIC, then he played a bit with C, ASM and Pascal. He tought himself MFC and Windows programming, to exploit his studies of C++. Always attracted by low-level programming and Assembly, he's beginning to appreciate the joys of templates and STL. At work he changed his mind about Java, discovered Eclipse IDE, and now think it's cool.
 
He lives in Follonica, Italy.
 
He has been abroad in the U.S. to work on his final thesis before graduating. For seven months he was playing with airplanes and automatic control at the Unversity of Illinois at Urbana-Champaign.
 
He graduated in Computer Science Engineering at the University of Pisa, Italy, in December 2003.
 
Currently working for an edutainment robotics company (www.robotechsrl.com).

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMulti Select Implemented PinmemberArun Yodyana10:02 9 Jun '06  
GeneralNetwork event PinmemberFred_1230:19 31 Aug '04  
GeneralRe: Network event PinmemberPaolo Messina1:06 31 Aug '04  
Generalc++ Pinsussziamustafa10:12 18 Jul '03  
GeneralExcuse Me PinsussFoolBear22:53 3 Jan '03  
GeneralRe: Excuse Me PinmemberPaolo Messina0:35 4 Jan '03  
GeneralRe: Excuse Me PinsussAnonymous21:36 5 Jan '03  
GeneralNetwork resources PinmemberTheron9:35 21 Jun '02  
GeneralRe: Network resources PinmemberPaolo Messina13:00 4 Aug '02  
GeneralAnimation problem Pinmemberf0tisx22:08 27 May '02  
GeneralRe: Animation problem PinmemberPaolo Messina7:27 28 May '02  
GeneralRe: Animation problem Pinmemberf0tisx20:05 28 May '02  
GeneralRe: Animation problem PinmemberPaolo Messina22:33 28 May '02  

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

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

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