Click here to Skip to main content
16,008,490 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to add "File Edit View..." menù in a CDialog ? Pin
Ravi Bhavnani21-Feb-02 7:41
professionalRavi Bhavnani21-Feb-02 7:41 
AnswerRe: How to add "File Edit View..." menù in a CDialog ? Pin
Paul M Watt21-Feb-02 8:05
mentorPaul M Watt21-Feb-02 8:05 
AnswerRe: How to add "File Edit View..." menù in a CDialog ? Pin
Mazdak21-Feb-02 8:12
Mazdak21-Feb-02 8:12 
AnswerThanks you :) Pin
Lockhart21-Feb-02 8:34
Lockhart21-Feb-02 8:34 
GeneralHelp with "automatic saving" Pin
Keith Goddard21-Feb-02 6:57
Keith Goddard21-Feb-02 6:57 
GeneralRe: Help with "automatic saving" Pin
Paul M Watt21-Feb-02 7:29
mentorPaul M Watt21-Feb-02 7:29 
GeneralRe: Help with "automatic saving" Pin
Keith Goddard21-Feb-02 8:00
Keith Goddard21-Feb-02 8:00 
GeneralRe: Help with "automatic saving" Pin
Keith Goddard23-Feb-02 2:53
Keith Goddard23-Feb-02 2:53 
Hmm... this didn't actually work out too well. The SetPathName function did manage to set the file name, but the default "Save As" dialog box was still called, just with the file name already set. My primary goal was to eliminate the appearance of the "Save As" dialog box, so I've only half solved the problem.

Perhaps its the way that I am automatically saving existing documents when the app closes? All I've done to accomplish this is override the SaveModified function. Now, I've added code to this function to check whether the document is named or not. If it isn't, I call the SetPathName function. Sample code:

BOOL CMyDoc::SaveModified()
{
if(!IsModified()
return TRUE;

CString strDocName;
strDocName=GetPathName();
if(strDocName=="")
{
COleDateTime today;
today=today.GetCurrentTime();
strDocName=today.Format("%d %B %Y");
SetPathName(strDocName,TRUE);

}

return DoFileSave(); //this line actually does the "autosaving"

}

It seems to me that I need to do something other than just call DoFileSave() at the end if I want to avoid the "Save As" dialog box. Or am I not using SetPathName correctly?


GeneralSmall Icons Pin
Aaron Schaefer21-Feb-02 6:08
Aaron Schaefer21-Feb-02 6:08 
GeneralRe: Small Icons Pin
Joaquín M López Muñoz21-Feb-02 6:27
Joaquín M López Muñoz21-Feb-02 6:27 
GeneralRe: Small Icons Pin
lucy21-Feb-02 8:33
lucy21-Feb-02 8:33 
GeneralRe: Small Icons Pin
Shog921-Feb-02 9:22
sitebuilderShog921-Feb-02 9:22 
GeneralRe: Small Icons Pin
Joaquín M López Muñoz21-Feb-02 9:30
Joaquín M López Muñoz21-Feb-02 9:30 
GeneralRe: Small Icons Pin
Tim Smith21-Feb-02 13:56
Tim Smith21-Feb-02 13:56 
GeneralRe: Small Icons Pin
Mazdak21-Feb-02 10:17
Mazdak21-Feb-02 10:17 
GeneralRe: Small Icons Pin
Jon Hulatt21-Feb-02 6:31
Jon Hulatt21-Feb-02 6:31 
GeneralHWND of focused window Pin
21-Feb-02 6:00
suss21-Feb-02 6:00 
GeneralRe: HWND of focused window Pin
Roger Stewart21-Feb-02 7:13
professionalRoger Stewart21-Feb-02 7:13 
GeneralRe: HWND of focused window Pin
21-Feb-02 7:55
suss21-Feb-02 7:55 
QuestionHow do I get Unicode automatically? Pin
Nish Nishant21-Feb-02 4:08
sitebuilderNish Nishant21-Feb-02 4:08 
AnswerRe: How do I get Unicode automatically? Pin
Joaquín M López Muñoz21-Feb-02 4:11
Joaquín M López Muñoz21-Feb-02 4:11 
GeneralRe: How do I get Unicode automatically? Pin
Nish Nishant21-Feb-02 9:19
sitebuilderNish Nishant21-Feb-02 9:19 
AnswerRe: How do I get Unicode automatically? Pin
Joao Vaz21-Feb-02 4:53
Joao Vaz21-Feb-02 4:53 
GeneralRe: How do I get Unicode automatically? Pin
Nish Nishant21-Feb-02 9:23
sitebuilderNish Nishant21-Feb-02 9:23 
AnswerRe: How do I get Unicode automatically? Pin
Michael Dunn21-Feb-02 8:10
sitebuilderMichael Dunn21-Feb-02 8:10 

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.