Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Embedded CFileDialog

Posted on 1998-11-01
4
Medium Priority
?
315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

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

Accepted Solution

by:
RONSLOW earned 1600 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

604 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