Click here to Skip to main content
15,886,799 members
Articles / Desktop Programming / MFC

A Class to Save and Load Listbox Data

Rate me:
Please Sign up or sign in to vote.
3.91/5 (13 votes)
2 Jan 20021 min read 173.6K   2.2K   44  
CListBoxSafe is a class that can save data from a listbox to file and load data from a file into a listbox.
// ListBoxSafe.h: interface for the CListBoxSafe class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_WINSTARTUP_H__61AB2BB8_97E3_47BB_91A2_17D620985B73__INCLUDED_)
#define AFX_WINSTARTUP_H__61AB2BB8_97E3_47BB_91A2_17D620985B73__INCLUDED_

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

class CListBoxSafe
{
public:
	CListBoxSafe();
	virtual ~CListBoxSafe();

public:	
	static void LoadList(CListBox &list, CString FileName, int MaxItems, int ItemLen);
	static void SaveList(CListBox &ListToFill, CString FileName, int MaxItems, int MaxItemLen);

};


#endif // !defined(AFX_WINSTARTUP_H__61AB2BB8_97E3_47BB_91A2_17D620985B73__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.


Written By
Belgium Belgium
bla bla bla

Comments and Discussions