Solved

Embedded CFileDialog

Posted on 1998-11-01
4
308 Views
Last Modified: 2013-11-20
Hi.
I'd like to do something like Visual Basic Open Project dialog, which is a property sheet that has the common file dialog in one of the pages.
The problem is that CFileDialog (which hooks the GetOpenFileName API) only opens as a modal dialog, and embedding it as a child is difficult... I tried several approaches like deriving from CFileDialog and in it's OnInitDone calling SetParent, but I had paint problems and, syncronization problems since the 'program flow' would stop when the call to the modal dialog was made, so I tried to create the common dialog in a seperate thread but this caused other problems...
Any ideas, pointers, something ?

   Thanks.

P.S. I don't want answers like 'use the .rc of the common dialog and create it yourself, and use the SHGetDesktopFolder and such and populate the list and tree...', I'd really like the actual common dialog embedded.
Not sure it can be done though, so help me out :)
0
Comment
Question by:dkremer
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:dkremer
ID: 1324111
Edited text of question
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 400 total points
ID: 1324112
Make it an extension to the file dialog.

You provide a template for your dialog (with tab control etc) and include a placeholder for where the file open dialog appears.

You'll have to then simulate the property sheet using a tab control and responding appropriately to messages.


0
 
LVL 1

Author Comment

by:dkremer
ID: 1324113
Thanks,
Didn't think about that... I wanted the easy way by using CPropertySheet\Page, wind up using seperate threads... now all I have to do is manage the visibility of the controls.... :)

    Thanks again,
      - Dror Kremer

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1324114
Be aware that the actual common dialog is the PARENT of your CFileDialog ... the file dialog controls are not children of the CFileDialog (so you cannot enumerate them of GetDlgItem etc) ... instead, do a GetParent and enum or GetDlgItem etc from there.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
List out all word 7 224
countEvens challenge 2 59
sum13 challenge 24 77
haveThree challenge 22 100
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: 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…
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

16 Experts available now in Live!

Get 1:1 Help Now