MDI - overriding OnFileClose

Hi experts,

When I override OnFileClose in my view, what do I call to do the closing after I'm done my personal code to close the view?  I've replaced the mechanism that does the closing and the window stays open... I don't want this of course..

Thanks!
Mike
mikexpertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mikexpertAuthor Commented:
Basically - I'm just calling my save function - and if it doesn't work - I don't want to close (or something like that) - my point is, it's never closing now and I want it to close after calling my OnFileSave function....

Thanks :-)
Jaime OlivaresSoftware ArchitectCommented:
If you review OnFileClose() source code implementation, you will find this:

void CDocument::OnFileClose()
{
     if (!SaveModified())
         return;

     // shut it down
     OnCloseDocument();
     // this should destroy the document
}

SaveModified will determine filename, ask you if you want to save or not, and finally call DoFileSave() if needed.

OnCloseDocument() will close all doc's views and delete the self doc object.

So, you just have to replace the SaveModified funcion with your own, leave OnCloseDocument() call.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mikexpertAuthor Commented:
Thanks Olivares!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.