user3494614
user3494614

Reputation: 603

Why MFC CDocument has SetTitle method and not CFrameWnd

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.

Upvotes: 2

Views: 931

Answers (2)

xMRi
xMRi

Reputation: 15365

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.

Upvotes: 1

GazTheDestroyer
GazTheDestroyer

Reputation: 21251

CFrameWnd does have a SetTitle method.

Upvotes: 0

Related Questions