?
Solved

Unique titles for views

Posted on 1998-06-19
3
Medium Priority
?
241 Views
Last Modified: 2013-11-20
I have several views open on the same document. MFC labels them document:1, document:2 and so on, and changing the document title changes the title of every view. I would like to use a unique title for each view. How can I do that?
0
Comment
Question by:viskju1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
Belgarat earned 300 total points
ID: 1318214
Override virtual member function `void OnUpdateFrameTitle(BOOL bAddToTitle)' defined in CFrameWnd.
The function is called when another frame for the document is opened.
The default implementation generates a text from m_strTitle member, document's name and window's number (in nonvirtual function UpdateFrameTitleForDocument).
You can override the default so that you will not call the inherited function and supply title entirely on your own.
If you're happy with the tittle the frame window get in call to the Create() member function, exclude FWS_ADDTOTITLE flag from the frame window's style - this prevents combining the frame title with the document name.
0
 

Expert Comment

by:YKunisky
ID: 1318215
I 'd have the same problem.

Try to use  CDocument::SetTytle() in every View.


void CYourView::OnInitialUpdate()
{
      CView::OnInitialUpdate();
      
      .........
      GetDocument()->SetTitle("Your name");
                .....
}

0
 

Author Comment

by:viskju1
ID: 1318216
Got it, thank you very much! (Actually I had to override OnUpdateFrameTitle in CMDIChildWnd.)

(- I have tried GetDocument()->SetTitle("Your name") earlier too, but it seems to change the title in all views at once.)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question