Solved

Directories Search Dialog

Posted on 2000-05-06
6
167 Views
Last Modified: 2013-11-20
Usually, setup/installation programs have an option of Browse Directory, for the directory in which to install the program. This option creates a Directory Search dialog, much like standard File Dialog but with directory tree only. Is there a standard dialog like that? If yes, where does it hide? If no, how can I _efficiently_ create one?
0
Comment
Question by:Lescha
  • 3
  • 2
6 Comments
 
LVL 23

Expert Comment

by:naveenkohli
Comment Utility
You can do this by using CFileDialog in MFC.

CFileDialog dlg;
dlg.DoModal ();

For more ino check out the documentation for this dialog box class.
0
 
LVL 1

Author Comment

by:Lescha
Comment Utility
I read and read and couldn't find how to force the CFileDialog to display only a directory tree, without the "files" window.

If there is a way to, please tell me.
0
 
LVL 23

Expert Comment

by:naveenkohli
Comment Utility
You will have to look at the documentation for OPENFILENAME structure. HEre you can speify the filters for the file list control. Here is some notes from documentation.

nFilterIndex
-------------
Specifies the index of the currently selected filter in the File Types control. The buffer pointed to by lpstrFilter contains pairs of strings that define the filters. The first pair of strings has an index value of 1, the second pair 2, and so on. An index of zero indicates the custom filter specified by lpstrCustomFilter. You can specify an index on input to indicate the initial filter description and filter pattern for the dialog box. When the user selects a file, nFilterIndex returns the index of the currently displayed filter.
If nFilterIndex is zero and lpstrCustomFilter is NULL, the system uses the first filter in the lpstrFilter buffer. If all three members are zero or NULL, the system does not use any filters and does not show any files in the file list control of the dialog box.

0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Author Comment

by:Lescha
Comment Utility
That's not what I meant!

Please re-read my question carefully: I meant the dialog which has an edit box, a tree control with directory and nothing more in it except for a few buttons.

It's no problem building one myself, but since every setup program has one, I thought maybe there is one somewhere.

If you are so sure about CFileDialog, could you please give a piece of code of how to use it for that end?
0
 
LVL 5

Accepted Solution

by:
proskig earned 30 total points
Comment Utility
I think this is what you are looking for
http://home.earthlink.net/~railro/mfc_link.html
0
 
LVL 1

Author Comment

by:Lescha
Comment Utility
Thanks!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
paragon account problem 9 96
bobThere java chalenge 45 82
centeredAverage challenge 8 120
isEverywhere  challenge 19 64
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

13 Experts available now in Live!

Get 1:1 Help Now