Solved

Directory Picker in VC++ 6.0 with MFC

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ORA-01403: no data found 43 101
FizzBuzz challenge 9 81
scoreUp challenge 14 63
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 583
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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