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

C / C++ / MFC

 
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 
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 
struct CONFIGFILE_RECORD
{
    char strPath[MAX_PATH]; // the path of the pic
    char nStyle[2];         // nStyle==0, IPIC_CENTER
                    // nStyle==1, IPIC_TILE
                    // nStyle==2, IPIC_STRETCH
}; // the record item of the config file

// one more byte for the null terminator
struct CONFIGFILE_HEADER
{
    char bHasPic[2];  // bHasPic==0, no pic paths are in the file
              // bHasPic==1
    char bOrder[2];   // bOrder==1, the wallpaper is changed according to the set order
                  // bOrder==0, randomly
    char nTime[5];    // the interval for wallpaper changing
              // max: 9000s = 2.5h
    char bEffect[2];  // bEffect==0, no special effect is used when the wallpaper is changing
              // bEffect==1

    char nNum[3];    // the number of pix

    char nPos[3];    // the last position in the file that indicates a particular pic path
             // 3 means this program supports up to 99 pics
}; // the header of the configuration file

BOOL CCfgFile::loadConfigFile()
{
	BOOL ret = FALSE;
	
	// get the current dir
	char dir[MAX_PATH];
	::GetCurrentDirectory( MAX_PATH, dir );
	strcat( dir, "\\config" );
	
	UINT mode = CFile::modeCreate | CFile::modeNoTruncate | CFile::modeReadWrite | CFile::shareDenyNone;
	if( fPic.m_hFile )
		fPic.Close();
	ret = fPic.Open( dir, mode );

	if( !fPic.GetLength() )
	{
		strcpy( hd.bHasPic, _T("0") );
		strcpy( hd.bOrder, _T("1") );
		strcpy( hd.nTime, _T("9999") );
		strcpy( hd.bEffect, _T("0") );
		strcpy( hd.nNum, _T("0") );
		strcpy( hd.nPos, _T("0") );
		fPic.Write( &hd, sizeof( CONFIGFILE_HEADER ) );
	} // some initializations if the file is not exised and created

	return ret;
}

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 
JokeRe: regarding creating databse Pin
Richard MacCutchan28-Mar-10 22:58
mveRichard MacCutchan28-Mar-10 22:58 
JokeRe: regarding creating databse Pin
Rajesh R Subramanian28-Mar-10 23:00
professionalRajesh R Subramanian28-Mar-10 23:00 
JokeRe: regarding creating databse Pin
Richard MacCutchan28-Mar-10 23:05
mveRichard MacCutchan28-Mar-10 23:05 

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.