Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

MFC Tree State Manager using XML

, 21 May 2002
Save and Restore multiple tree states in your MFC applications
tbtreestatemgr_demo.zip
TreeStateSaverDemo
TreeStateSaverDemo.clw
res
TreeStateSaverDemo.ico
Toolbar.bmp
Debug
msxml.tlh
TreeStateSaverDemo.plg
TreeStateSaverDemo.dsp
TreeStateSaverDemo.aps
Release
msxml.tlh
CtlStateStg.ctss
TreeStateSaverDemo.res
vc60.idb
StdAfx.obj
TreeStateSaverDemo.obj
TBTreeStateMgr.obj
MainFrm.obj
ChildView.obj
TreeStateSaverDemo.exe
CtlStateStg.ctss
tbtreestatemgr_src.zip
// ChildView.h : interface of the CChildView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_CHILDVIEW_H__95BB3243_BE02_48B6_8B8D_D7F5F4491AC3__INCLUDED_)
#define AFX_CHILDVIEW_H__95BB3243_BE02_48B6_8B8D_D7F5F4491AC3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CChildView window
#include <afxcview.h>
class CChildView : public CWnd
{
// Construction
public:
	CChildView();

// Attributes
protected:
	typedef struct {
		char * parentItem;
		char * text;
	} NODEINFO_T;

	CTreeView		* wnd_Tree1;
	CTreeView		* wnd_Tree2;
	CTreeView		* wnd_Tree3;
	CTreeView		* wnd_Tree4;
	CSplitterWnd	wnd_Splitter;

// Operations
protected:
	void	LoadTree(CTreeCtrl &ctrl);
void CChildView::LoadTreeData(HTREEITEM hParent,
							  LPCSTR name,
							  const NODEINFO_T * pTreeData,
							  CTreeCtrl &ctrl);

// For testing large tree for n.franks comment
// i am curious too about the performance
void LoadGiantTree(CTreeCtrl &ctrl);
void PopulateLargeTree(HTREEITEM hParent, 
					   ULONG nChildren, 
					   ULONG nCurrDepth, 
					   ULONG nMaxDepth,
					   CTreeCtrl * pTree);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CChildView)
	protected:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CChildView();

	// Generated message map functions
protected:
	//{{AFX_MSG(CChildView)
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnDestroy();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CHILDVIEW_H__95BB3243_BE02_48B6_8B8D_D7F5F4491AC3__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

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

Share

About the Author

Vivek Rajan
Web Developer
India India
C++/MFC/Java programmer, I like to work on high performance user interface programming.

| Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 22 May 2002
Article Copyright 2002 by Vivek Rajan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid