Click here to Skip to main content
15,903,012 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Get out of infinite loop question! Pin
Aneurysm0031-Jan-05 7:17
Aneurysm0031-Jan-05 7:17 
GeneralRe: Get out of infinite loop question! Pin
Tim Smith31-Jan-05 13:44
Tim Smith31-Jan-05 13:44 
Questionhow to add a menu to a CDialogBar Pin
vieira_alice31-Jan-05 5:51
vieira_alice31-Jan-05 5:51 
AnswerRe: how to add a menu to a CDialogBar Pin
JohnCz31-Jan-05 14:19
JohnCz31-Jan-05 14:19 
GeneralUndo Pin
act_x31-Jan-05 5:41
act_x31-Jan-05 5:41 
GeneralRe: Undo Pin
PJ Arends31-Jan-05 6:07
professionalPJ Arends31-Jan-05 6:07 
GeneralRe: Undo Pin
Maximilien31-Jan-05 6:47
Maximilien31-Jan-05 6:47 
GeneralProblem with file output Pin
RealityGamma31-Jan-05 5:29
sussRealityGamma31-Jan-05 5:29 
Im having this wierd problem regarding outputing a file in the same path as the .exe, whenever i save the settings for my app it always save it to the desktop i have no idea why...its suppose to save it in the same path as the exe.. this is the first time ive had this kind of problem, this is almost the same code i always use and yet its not working the way it should be i dont know why..Frown | :(


heres the code
heres the defined values:

#define FILENAME_S "settings.ini"
#define STRINGi "Font=%s\nFont_Size=%d\nShow_Margin=%d\nShow_Toolbar=%d\nShow_Workspace=%d\nShow_Status=%d\nFile1=%s\nFile2=%s\nFile3=%s\nFile4=%s"


This is part of this FILESTUFF CLass

int FILESTUFF::saveIni( SETTINGS *st )
{
FILE *file;

if( ( file = fopen( FILENAME_S, "w+" ) ) == NULL )
return 0;

stripSpace( st->font, 1 );
stripSpace( st->file1, 1 );
stripSpace( st->file2, 1 );
stripSpace( st->file3, 1 );
stripSpace( st->file4, 1 );

fprintf( file, STRINGi , st->font, st->fontSize, st->showMargin, st->showToolbar, st->showWorkspace, st->showStatusBar, st->file1, st->file2, st->file3, st->file4 );
loadIni( &*st );
fclose( file );
return 1;
}

int FILESTUFF::loadIni( SETTINGS *st )
{
FILE *file;

if( ( file = fopen( FILENAME_S, "r+" ) ) == NULL )
return 0;

fscanf( file, STRINGi , st->font, &st->fontSize, &st->showMargin, &st->showToolbar, &st->showWorkspace, &st->showStatusBar, st->file1, st->file2, st->file3, st->file4 );
stripSpace( st->file1, 0 );
stripSpace( st->file2, 0 );
stripSpace( st->file3, 0 );
stripSpace( st->file4, 0 );
return 1;

fclose( file );
}


I have no idea
GeneralRe: Problem with file output Pin
PJ Arends31-Jan-05 6:18
professionalPJ Arends31-Jan-05 6:18 
GeneralRe: Problem with file output Pin
RealityGamma31-Jan-05 7:34
sussRealityGamma31-Jan-05 7:34 
GeneralRe: Problem with file output Pin
David Crow31-Jan-05 9:23
David Crow31-Jan-05 9:23 
GeneralAfxBeginThread, Thread Pool and RUNTIME_CLASS Pin
Turtle Hand31-Jan-05 4:22
Turtle Hand31-Jan-05 4:22 
GeneralRe: AfxBeginThread, Thread Pool and RUNTIME_CLASS Pin
PJ Arends31-Jan-05 6:03
professionalPJ Arends31-Jan-05 6:03 
GeneralAutomating MS Access Pin
mcsherry31-Jan-05 4:00
mcsherry31-Jan-05 4:00 
GeneralRe: Automating MS Access Pin
David Crow31-Jan-05 4:29
David Crow31-Jan-05 4:29 
GeneralRe: Automating MS Access Pin
mcsherry31-Jan-05 21:44
mcsherry31-Jan-05 21:44 
GeneralRe: Automating MS Access Pin
David Crow1-Feb-05 3:21
David Crow1-Feb-05 3:21 
GeneralRe: Automating MS Access Pin
Bob Flynn31-Jan-05 5:25
Bob Flynn31-Jan-05 5:25 
QuestionIs this possbile??? Pin
rlepine31-Jan-05 3:26
rlepine31-Jan-05 3:26 
AnswerRe: Is this possbile??? Pin
User 665831-Jan-05 3:40
User 665831-Jan-05 3:40 
GeneralRe: Is this possbile??? Pin
rlepine31-Jan-05 3:45
rlepine31-Jan-05 3:45 
AnswerRe: Is this possbile??? Pin
David Crow31-Jan-05 3:52
David Crow31-Jan-05 3:52 
GeneralRe: Is this possbile??? Pin
rlepine31-Jan-05 3:58
rlepine31-Jan-05 3:58 
Generalmaintaining layout of window Pin
doneirik31-Jan-05 2:36
doneirik31-Jan-05 2:36 
GeneralRe: maintaining layout of window Pin
Maximilien31-Jan-05 2:42
Maximilien31-Jan-05 2:42 

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.