Solved

Directory Picker in VC++ 6.0 with MFC

Posted on 2000-04-30
5
373 Views
Last Modified: 2013-11-20
I want to get a directory through a dialog. There is a standard dialog that allows you to select a file, but not only a directory. Also, I cannot use ActiveX (WinNT).
How can I manage that?

0
Comment
Question by:ToniVR
[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
5 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 10 total points
ID: 2764065
Unfortunately, there's no MFC class to help you.  But there is an API: SHBrowseForFoder(). It'll present a dialog htat lets the user browse for a folder throughout their system.

..B ekiM
0
 
LVL 44

Expert Comment

by:bruintje
ID: 2764071
Hi TonyVR,

A bit of a trick...but couldn't you selct the file and cut of the filename to get the directory selected?

or try MS
http://support.microsoft.com/support/kb/articles/Q105/4/97.asp

The DIRPK sample was designed using the old style of common file dialogs and will work as intended only on Windows NT 3.51. On Windows 95 and future versions of NT (4.0), if you want to use the old style of common file dialogs, insure that:

HTH:O)Bruintje
0
 
LVL 2

Author Comment

by:ToniVR
ID: 2766135
I've already found some code to manage the problem. But thanx anyway!!!
0
 
LVL 2

Author Comment

by:ToniVR
ID: 2766150
Bruintje, I tried to use the DIRPK sample, but it didn't work properly (or I couldn't manage to implement it). But some other dude at C++ Programming Questions gave me a small, but very efficient sollution!
0
 
LVL 44

Expert Comment

by:bruintje
ID: 2766209
that's okay glad you got it working!
0

Featured Post

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 139
repeateFront java challenge 31 95
sumNumber challenge 16 140
Problem to open Excel file 15 226
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…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 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