2
votes

I just started looking at an MFC code of new project, I am assigened to and didn't had much coding done before in MFC. I can see that MFC document view architecture basically assigns all display related tasks to view, Frame handles communication with windows, and document holds all application related data.

But then I am wondering why MFC has SetTitle method in CDocument class and not in CFrameWnd class? On the other hand to set text in status bar you got method SetMessageText in CFrameWnd ?

Thanks In advance.

2

2 Answers

1
votes

It is already said, that CFrameWnd has a SetTitle method.

But beside that: The reason is simple. A CFrameWnd can contain and serve more than one Document. Depending on the active docucment it should show the title of this determined CDoucment.

And each CDocument can have its own title.