Solved

Embedded CFileDialog

Posted on 1998-11-01
4
309 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 94
viewing source code from eclipse 13 88
isEverywhere  challenge 19 72
modThree challenge 4 79
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…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

895 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

12 Experts available now in Live!

Get 1:1 Help Now