Solved

Embedded CFileDialog

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

829 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