Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBeginners Guide / Visual C++ 2008 Express Edition written by Herb Schildt Pin
painterdave28-Mar-10 19:54
painterdave28-Mar-10 19:54 
AnswerRe: Beginners Guide / Visual C++ 2008 Express Edition written by Herb Schildt Pin
CPallini28-Mar-10 20:51
mveCPallini28-Mar-10 20:51 
GeneralRe: Beginners Guide / Visual C++ 2008 Express Edition written by Herb Schildt Pin
painterdave30-Mar-10 19:39
painterdave30-Mar-10 19:39 
GeneralRe: Beginners Guide / Visual C++ 2008 Express Edition written by Herb Schildt Pin
CPallini30-Mar-10 20:44
mveCPallini30-Mar-10 20:44 
AnswerRe: Beginners Guide / Visual C++ 2008 Express Edition written by Herb Schildt Pin
Richard MacCutchan28-Mar-10 23:18
mveRichard MacCutchan28-Mar-10 23:18 
AnswerRe: Beginners Guide / Visual C++ 2008 Express Edition written by Herb Schildt Pin
David Crow29-Mar-10 2:56
David Crow29-Mar-10 2:56 
AnswerRe: Beginners Guide / Visual C++ 2008 Express Edition written by Herb Schildt Pin
Tim Craig29-Mar-10 13:40
Tim Craig29-Mar-10 13:40 
Questionbuffer problems with CFile Pin
Krauze28-Mar-10 19:36
Krauze28-Mar-10 19:36 
This class is used to save the pix paths in the ListBox into a file. CListItemData is a class that stores
additional info for every item in ListBox. This class operates correctly.
void CCfgFile::Serialize( const CListItemData& lid, const CListBox& lst )
{
	loadConfigFile(); // a private funx which loads the file, it works correctly

	fPic.Seek( sizeof( CONFIGFILE_HEADER ), CFile::begin );
        // ommit the header section and move to the data

	CString str;
	int i = 0;
	while( i < lst.GetCount() )
	{
		// get the pic full path by combining the data in CListItemData and CListBox
		lst.GetText( i, str );
		str = lid.GetDir(i) + _T("\\") + str + _T(".") + lid.GetType(i);

		// initialize rcd, a structure for the file data
		memset( rcd.strPath, 0, sizeof( rcd.strPath ) );
		memset( rcd.nStyle, 0, sizeof( rcd.nStyle ) );
		
                // write the data into rcd structure
		strcpy( rcd.strPath, str );
		itoa( lid.GetStyle(i), rcd.nStyle, 10 );
		rcd.nStyle[1] = '\0';
	        
                // write the structure into file
		fPic.Write( &rcd, sizeof( CONFIGFILE_RECORD ) );
		
                i++;
		
	}

	fPic.Close();
}

The prob occurs. Sometimes the file buffer is updated and the ListBox can show the updated data. But after I exit the proram, the disk file is not updated. This really confuses me. Even if I use CFile::Flush(), it's the same. Anyone could help me out? Really thanx.
AnswerRe: buffer problems with CFile Pin
hanq_3891013028-Mar-10 19:55
hanq_3891013028-Mar-10 19:55 
AnswerRe: buffer problems with CFile Pin
Iain Clarke, Warrior Programmer28-Mar-10 20:26
Iain Clarke, Warrior Programmer28-Mar-10 20:26 
AnswerRe: buffer problems with CFile Pin
Krauze29-Mar-10 3:53
Krauze29-Mar-10 3:53 
QuestionRe: buffer problems with CFile Pin
David Crow29-Mar-10 4:30
David Crow29-Mar-10 4:30 
AnswerRe: buffer problems with CFile Pin
Vaclav_29-Mar-10 5:38
Vaclav_29-Mar-10 5:38 
GeneralRe: buffer problems with CFile Pin
Krauze29-Mar-10 18:20
Krauze29-Mar-10 18:20 
QuestionHow to add command buttons to listbox? Pin
space03528-Mar-10 16:32
space03528-Mar-10 16:32 
AnswerRe: How to add command buttons to listbox? Pin
Adam Roderick J28-Mar-10 17:37
Adam Roderick J28-Mar-10 17:37 
GeneralRe: How to add command buttons to listbox? Pin
space0359-Apr-10 22:37
space0359-Apr-10 22:37 
QuestionPseudo Code for B Spline implementation Pin
Chidori-chan28-Mar-10 15:35
Chidori-chan28-Mar-10 15:35 
AnswerRe: Pseudo Code for B Spline implementation Pin
LunaticFringe28-Mar-10 15:46
LunaticFringe28-Mar-10 15:46 
GeneralRe: Pseudo Code for B Spline implementation Pin
Chidori-chan28-Mar-10 15:49
Chidori-chan28-Mar-10 15:49 
AnswerRe: Pseudo Code for B Spline implementation Pin
loyal ginger28-Mar-10 15:51
loyal ginger28-Mar-10 15:51 
GeneralRe: Pseudo Code for B Spline implementation Pin
Chidori-chan28-Mar-10 15:55
Chidori-chan28-Mar-10 15:55 
Generalregarding creating databse Pin
kirancgi27-Mar-10 23:40
kirancgi27-Mar-10 23:40 
GeneralRe: regarding creating databse Pin
Richard MacCutchan28-Mar-10 1:12
mveRichard MacCutchan28-Mar-10 1:12 
JokeRe: regarding creating databse Pin
David Crow28-Mar-10 16:22
David Crow28-Mar-10 16:22 

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.