ferryjenny
Technical User
I am trying to write the contents of an edit box to a txt file however it is not working. When the dialog is first opened the edit box contains some text and the user then changes this text. I have written the code below to write the text in the edit box to a file.
FILE* fp;
if((fp = fopen("file.txt","w")==NULL)
{
AfxMessageBox("the file was not opened"
exit(0);
}
fputs(_editbox,fp);
However this only writes the text that was in the edit box initially and not the new text that the user has entered. Thanks for any help received.
FILE* fp;
if((fp = fopen("file.txt","w")==NULL)
{
AfxMessageBox("the file was not opened"
exit(0);
}
fputs(_editbox,fp);
However this only writes the text that was in the edit box initially and not the new text that the user has entered. Thanks for any help received.