Solved

CFileDialog !

Posted on 2000-05-04
5
317 Views
Last Modified: 2013-11-20
Hi,
I want to change the caption SAVE of Save As Dialog to say "Guru".How will I achieve it ?Mine is a Dialog based application.

Here is the code I have written:

CMyFileDialog dlg(FALSE);

In the oninitdialog method of MyFileDialog I have written :

CWnd* pWnd = GetPArent();
CWnd* pChild = pWnd->GetDlgItem(IDOK);
pChild->SetWindowText("Guru");

Pls help me out to sort this problem.
0
Comment
Question by:gurukg102498
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2777510
I am unsure as to why you are asking for the parent window? Have you tried

CWnd* pChild = GetDlgItem(IDOK);
pChild->SetWindowText("Guru");

0
 
LVL 5

Expert Comment

by:proskig
ID: 2778050
Sorry, if you want to change caption of a dialog, why do you call GetDlgItem(IDOK)???
0
 
LVL 1

Accepted Solution

by:
tvanceplus earned 50 total points
ID: 2778389
before you call DoModal() for your dlg object, insert the statement

dlg.m_ofn.lpstrTitle="Guru";

That should work for you.

Good Luck!

tvanceplus
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2779877
> Sorry, if you want to change caption of a dialog, why do you call GetDlgItem(IDOK)

that's true - I thought he meant the button

0
 
LVL 1

Expert Comment

by:tvanceplus
ID: 2781015
I think he means the dialog, but I could be wrong.

to gurukg

please, in the future, make your questions very specific and descriptive. This will help others give you the information you need.

tvanceplus
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 32
has77  challenge 9 82
Use of condition with 'serial' in ansible 2 58
Fibonacci challenge 11 120
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

815 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now