Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unique titles for views

Posted on 1998-06-19
3
Medium Priority
?
252 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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