?
Solved

Doubt related to VC++ 5.0

Posted on 1998-11-11
9
Medium Priority
?
191 Views
Last Modified: 2010-04-02
I would like to know how do i browse for a directory when a button is pressed.Basically i need to locate where the cd drive is , that is the path.
I hope u got my question. Its something like when i use a normal file->Open option then i have a pull down button which allows me to browse thro' the dir. and select one particular dir. of my choice.
0
Comment
Question by:charul
[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
  • 4
  • 3
  • 2
9 Comments
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1177595
If you are using MFC, I recommend you go here:

http://www.codeguru.com/dialog/dir_picker.shtml

for an excellent dialog box for picking directories.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1177596
In fact, there are whole slew of them here (five total):
http://www.codeguru.com/dialog/dialog_toc.shtml

If you have any questions regarding them, please feel free to ask.  Thanks!
0
 
LVL 86

Accepted Solution

by:
jkr earned 300 total points
ID: 1177597
>>Basically i need to locate where the cd drive is , that is the path.

If all you need is locating the CD drive, use this:

    DWORD   dwDrives;
    UINT    uDriveType;
    char    cDrive;
    char    acDriveName [   _MAX_DRIVE];

        for (   cDrive  =   0;  cDrive  <   26; cDrive++)
            {
                wsprintf    (   acDriveName,    "%c:\\",      cDrive      +      'A');

                uDriveType  =   GetDriveType(   acDriveName);
               
                if  (   DRIVE_CDROM ==  uDriveType)
                    {
                        // now acDriveName containes the drive letter of your CDROM...
                    }
            }

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:charul
ID: 1177598
I CDirDialog class ,  there is  a datatype OLECHAR,LPSHELLHOLDER  what are these exactly ? Are these .cpp files, some DLLs. so that i could plug into my code.
Please could u try to explain this ?
0
 

Author Comment

by:charul
ID: 1177599
jkr's
  i have a question, in the code that u have suggested , DRIVE_CDROM, should be typedef ?
0
 

Author Comment

by:charul
ID: 1177600
jkr's
  i have a question, in the code that u have suggested , DRIVE_CDROM, should be typedef ?
0
 
LVL 86

Expert Comment

by:jkr
ID: 1177601
No, DRIVE_CDROM is #define'd in 'winbase.h'
0
 

Author Comment

by:charul
ID: 1177602
to JKR's
  So will i have to include 'winbase.h' file (if its a std. file) into my vc++ project, i.e whereever i use the above code mentioned ?
0
 
LVL 86

Expert Comment

by:jkr
ID: 1177603
Well, 'winbase.h' is usually being included by 'windows.h' anyway, so you shouldn't have to do that manually...
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

800 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