Getting from CDocument to frame
-
This seems a depressingly typical problem with learning MFC. :( All the examples of changing view, of course, assume you're doing it in the frame window, in response to a message. I'm trying to do it from the CDocument (switching to an errors list if the incoming document fails to validate). How the devil do I find my way to the frame window object from there? I suppose, if I get really desperate, I can store a pointer to my frame window in a global inside it's constructor but please tell me there's a better way than that. This seems to be part of a pattern with MFC. Object instances are created inside MFC methods and hidden away from the programmer in undocumented and unsupported members. Persnally I think that the whole thing would be much better if the CRuntimeClass stuff had never been dreamed up.
-
This seems a depressingly typical problem with learning MFC. :( All the examples of changing view, of course, assume you're doing it in the frame window, in response to a message. I'm trying to do it from the CDocument (switching to an errors list if the incoming document fails to validate). How the devil do I find my way to the frame window object from there? I suppose, if I get really desperate, I can store a pointer to my frame window in a global inside it's constructor but please tell me there's a better way than that. This seems to be part of a pattern with MFC. Object instances are created inside MFC methods and hidden away from the programmer in undocumented and unsupported members. Persnally I think that the whole thing would be much better if the CRuntimeClass stuff had never been dreamed up.