Click here to Skip to main content
15,900,818 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Deranged CHtmlCtrl Pin
monrobot1329-Oct-02 7:10
monrobot1329-Oct-02 7:10 
GeneralCFileDialog?? HELP! Pin
Pett28-Oct-02 13:06
Pett28-Oct-02 13:06 
GeneralEvent Handling Problem in WIN32/MFC App. Pin
loopguru28-Oct-02 12:58
loopguru28-Oct-02 12:58 
QuestionHow to get icons of all opened windows? Pin
Artem Moroz28-Oct-02 12:16
Artem Moroz28-Oct-02 12:16 
AnswerRe: How to get icons of all opened windows? Pin
dabs31-Oct-02 4:46
dabs31-Oct-02 4:46 
GeneralRe: How to get icons of all opened windows? Pin
Artem Moroz31-Oct-02 10:32
Artem Moroz31-Oct-02 10:32 
GeneralRe: How to get icons of all opened windows? Pin
dabs31-Oct-02 13:03
dabs31-Oct-02 13:03 
GeneralSaving with MFC Pin
dinner@628-Oct-02 11:30
dinner@628-Oct-02 11:30 
Hello All,

I am new to MFC - but have used C for around 3 years so I have the basics sorted out.
My question is I am trying to write my own saving routine and have created a SaveFile funtion in which I am using fwrite, to save information to a txt file - the problem being is it will save fine until the code reaches the line : saveArchive.Close(); in Doccore.cpp, this then clears the file.
Now being new to MFC Ihave learnt a fair amount on my own but cannot seem to solve this problem.
If this helps here is my code in my savefile function.

void CMy_newDoc :: SaveFile(const char *filename)
{

char buffer[255];
FILE *file = fopen (filename, "w+");

sprintf (buffer, "Text tobe saved into file");
fwrite( buffer, sizeof( char ), sizeof(buffer), file );

fclose(file);
}

Thanks in adavance for helping a newbie to MFC
GeneralRe: Saving with MFC Pin
Christian Graus28-Oct-02 11:34
protectorChristian Graus28-Oct-02 11:34 
GeneralRe: Saving with MFC Pin
valikac28-Oct-02 11:37
valikac28-Oct-02 11:37 
GeneralRe: Saving with MFC Pin
dinner@628-Oct-02 11:59
dinner@628-Oct-02 11:59 
GeneralRe: Saving with MFC Pin
valikac28-Oct-02 12:12
valikac28-Oct-02 12:12 
GeneralRe: Saving with MFC Pin
Christian Graus28-Oct-02 13:25
protectorChristian Graus28-Oct-02 13:25 
GeneralRe: Saving with MFC Pin
ian mariano28-Oct-02 17:38
ian mariano28-Oct-02 17:38 
GeneralCImage -- Can't get it working Pin
nde_plume28-Oct-02 11:26
nde_plume28-Oct-02 11:26 
GeneralRe: CImage -- Can't get it working Pin
Christian Graus28-Oct-02 11:31
protectorChristian Graus28-Oct-02 11:31 
GeneralStrange Problem. Pin
Anonymous28-Oct-02 10:25
Anonymous28-Oct-02 10:25 
GeneralRe: Strange Problem. Pin
Maximilien28-Oct-02 10:35
Maximilien28-Oct-02 10:35 
GeneralRe: Strange Problem. Pin
Anonymous28-Oct-02 11:08
Anonymous28-Oct-02 11:08 
GeneralQuestion concerning bitmaps Pin
Steven M Hunt28-Oct-02 10:22
Steven M Hunt28-Oct-02 10:22 
GeneralRe: Question concerning bitmaps Pin
Christian Graus28-Oct-02 10:29
protectorChristian Graus28-Oct-02 10:29 
GeneralMFC/Win32 MicroPhone Mute Pin
Moshe Bergman28-Oct-02 10:01
sussMoshe Bergman28-Oct-02 10:01 
GeneralRe: MFC/Win32 MicroPhone Mute Pin
ian mariano28-Oct-02 17:43
ian mariano28-Oct-02 17:43 
GeneralSending Keyboard Events to a Window Pin
Abin28-Oct-02 9:31
Abin28-Oct-02 9:31 
GeneralRe: Sending Keyboard Events to a Window Pin
Christian Graus28-Oct-02 10:17
protectorChristian Graus28-Oct-02 10:17 

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.