Solved

MFC Programming question

Posted on 1997-07-01
5
207 Views
Last Modified: 2013-11-20

What is the easiest way to customize the Explorer-stly FileOpen dialog using MFC?  I know how to do it SDK-style by hooking the dialog procedure and I know how to customize the old-style common dialogs in MFC by using a child window dialog containing the new controls, but I am looking for a more elegant way to be able to add my own controls to the dialog.  Am I stuck with dynamically placing the controls on the dialog and hooking into it for processing?  Has somebody already solved this problem?

Thank in advance...
0
Comment
Question by:derrickh
  • 3
5 Comments
 
LVL 4

Expert Comment

by:AVaulin
ID: 1302411
You must write class delivered from CFileDialog, add any controls you want in OnInitDialog method (use Create method for each control) and handle any messages you need (if for example you want to add button you must use ON_COMMAND macro to add button pressing handle).
Good luck.
0
 

Author Comment

by:derrickh
ID: 1302412
You told me what I already said in the question: "Am I stuck with dynamically placing the controls on the dialog and hooking into it for processing?"

This is exactly what I didn't want to do.  The method that is more MFC-like is to create a dialog template with the new controls using the VC Studio and attach it to the default dialog using the DS_CHILD and OFN_ENABLETEMPLATE flag.  If I do that though, I still need to be able to capture all of the new controls' messages.  Can I still do this in the message map? And if so, can you please elaborate a little more than you did in the original answer.  

I am trying to avoid using the "OFN_ENABLEHOOK" flag for the new controls.
0
 
LVL 1

Accepted Solution

by:
MarkusLoibl earned 0 total points
ID: 1302413
I have some little code for your problem, tell me your e-mail and I'll send you
0
 

Author Comment

by:derrickh
ID: 1302414
My e-mail is derrick@prismnet.com.
0
 

Author Comment

by:derrickh
ID: 1302415
That's it!  The MFC solution using the OnInitDone() was what I was looking for.  Thanks!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 92
maven archtype selection in eclipse 1 57
Execute multiple curl cmds with sleep and send output to file 10 97
Path of Workbook 3 74
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

8 Experts available now in Live!

Get 1:1 Help Now