The code below opens the dialog fine and saves fine with the GetFileName function. However, the already existing file (fprint.txt) that I want the Save As dialog to focus on is not being used. A new file is being created instead with out the contents of the existing file. Thanks for the info. Looking forward to a solution.
Code:
CString strfileName;
FILE* stream;
stream = fopen( "fprintf.txt", "a+");
CFileDialog saveFile( FALSE, ".txt", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"Text file (*.txt)|*.txt|" , NULL );
saveFile.m_ofn.lpstrTitle = "Save file as...";
if(IDOK == saveFile.DoModal()) {
strfileName = saveFile.GetFileName();
fprintf(stream, strfileName);
}
James