www.pudn.com > PropertyListCtrl.rar > MyList.h


#if !defined(_MYLIST_H) 
#define _MYLIST_H 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
// MyList.h 
// 
///////////////////////////////////////////////////////////////////////////// 
// 
// Copyright © 1999, Stefan Belopotocan, http://welcome.to/StefanBelopotocan 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#include  
 
////////////////////////////////////////////////////////////////////// 
// CMyTypedPtrList 
 
template 
class CMyTypedPtrList : public CTypedPtrList 
{ 
public: 
	CMyTypedPtrList(int nBlockSize = 10)  
		: CTypedPtrList(nBlockSize)  
	{ 
	} 
 
	~CMyTypedPtrList() 
	{ 
		Destroy(); 
	} 
 
	void Destroy() 
	{ 
		POSITION pos = GetHeadPosition(); 
 
		while(pos != NULL) 
		{ 
			TYPE node = GetNext(pos); 
			delete node; 
		} 
 
		RemoveAll(); 
	} 
}; 
 
#endif //!defined(_MYLIST_H)