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
Solved

Directory Picker in VC++ 6.0 with MFC

Posted on 2000-04-30
5
366 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Title # Comments Views Activity
Unix / Linux grid computing 5 163
Doc'in system (example?) BA 7 115
Line meaning 9 87
sumHeights2  challenge 7 114
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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 …
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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