ID_File_New
-
Hi, I have created a SDI with FormView. The data from the view can be stored into a file and when the file is clicked, it opens directly into the formview with the edit boxes automatically filled. Now, when one file/document is open, if the user selects
File-New
from the menu, a new document opens and all the fields on the Form get reset (set to zero). The previously open document gets closed. I would like to ask the user if he would like to save the data before opening a new document. I have put this option when the Exit button is clicked, but am not able to figure out how to**open a new document**
after the saving process is over. Please help!_
Fortitudine Vincimus!_
-
Hi, I have created a SDI with FormView. The data from the view can be stored into a file and when the file is clicked, it opens directly into the formview with the edit boxes automatically filled. Now, when one file/document is open, if the user selects
File-New
from the menu, a new document opens and all the fields on the Form get reset (set to zero). The previously open document gets closed. I would like to ask the user if he would like to save the data before opening a new document. I have put this option when the Exit button is clicked, but am not able to figure out how to**open a new document**
after the saving process is over. Please help!_
Fortitudine Vincimus!_
-
Override CDocument::OnCloseDocument().
You may be right
I may be crazy
-- Billy Joel --Within you lies the power for good, use it!!!
AH!! This works ... Is it the correct way? I added this in the MainFrame Class:
void CMainFrame::OnFileNew()
{
CSFPAView *pFV = (CSFPAView *)GetActiveView();
if (pFV->DoBeforeExit())
{
CSingleDocTemplate * pTemplate = (CSingleDocTemplate *) GetActiveDocument()->GetDocTemplate();
pTemplate->OpenDocumentFile(NULL);
}}
_
Fortitudine Vincimus!_
-
Hi, I have created a SDI with FormView. The data from the view can be stored into a file and when the file is clicked, it opens directly into the formview with the edit boxes automatically filled. Now, when one file/document is open, if the user selects
File-New
from the menu, a new document opens and all the fields on the Form get reset (set to zero). The previously open document gets closed. I would like to ask the user if he would like to save the data before opening a new document. I have put this option when the Exit button is clicked, but am not able to figure out how to**open a new document**
after the saving process is over. Please help!_
Fortitudine Vincimus!_
Tara14 wrote:
I would like to ask the user if he would like to save the data before opening a new document.
If the document contents have not changed, no prompt is necessary. Otherwise, look at the
SetModifiedFlag()
method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb