?
Solved

Directory Picker in VC++ 6.0 with MFC

Posted on 2000-04-30
5
Medium Priority
?
383 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 30 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

765 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