The point I was trying to make there is that his advise doesn't work, and that he should try the code before he posts it.
....obviously it's going to take more than sending a message from a non-member function because the OnFileNew base class function is PROTECTED!!!!!!!!!!!!!
Last edited by ADSOFT; April 15th, 2009 at 10:12 AM.
Re: How to call OnFileNew() from a dialog box in MFC VC++?
Originally Posted by ADSOFT
....obviously it's going to take more than sending a message from a non-member function because the OnFileNew base class function is PROTECTED!!!!!!!!!!!!!
What does "sending a message from a non-member function" have to do with the declaration type (public/protected/private) of CWinApp::OnFileNew message handler?
Re: How to call OnFileNew() from a dialog box in MFC VC++?
Originally Posted by ADSOFT
The point I was trying to make there is that his advise doesn't work, and that he should try the code before he posts it.
....obviously it's going to take more than sending a message from a non-member function because the OnFileNew base class function is PROTECTED!!!!!!!!!!!!!
You're taking this a little too seriously. So, it was protected. Override it or send a message. What's the big deal? The point remains that OnFileNew is an app function, not a view function, and that maintaining a global pointer to a view wasn't a particularly good solution to the problem. Don't take it so personally.
Re: How to call OnFileNew() from a dialog box in MFC VC++?
Originally Posted by GCDEF
You're taking this a little too seriously. So, it was protected. Override it or send a message. What's the big deal? The point remains that OnFileNew is an app function, not a view function, and that maintaining a global pointer to a view wasn't a particularly good solution to the problem. Don't take it so personally.
I thought we all agreed that OnFileNew was an App function, it was an oversite on my part thinking it was part of the View, that's why we got back on topic. I had a simular situation arise when I had to print from Dialog boxes in my app, at first I sent messages then created a pointer to the View, so I could print from anywhere in the app; .... so sorry for the confusion on that part.
Yes the function is protected and if I would have addressed the problem without mentioning that, then some of these guys would have raised a storm.
Bookmarks