BOOL CDocument::DoSave( LPCTSTR lpszPathName, BOOL bReplace ) /***********************************************************/ { CString strPathName; if( lpszPathName != NULL ) { strPathName = lpszPathName; } else { CWinApp *pApp = AfxGetApp(); ASSERT( pApp != NULL ); if( !pApp->DoPromptFileName( strPathName, AFX_IDS_SAVEFILE, OFN_PATHMUSTEXIST, FALSE, m_pDocTemplate ) ) { return( FALSE ); } } if( !OnSaveDocument( strPathName ) ) { return( FALSE ); } if( bReplace ) { SetPathName( strPathName ); } return( TRUE ); }