Solved

Doubt related to VC++ 5.0

Posted on 1998-11-11
9
180 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
  • 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 100 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
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.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Find Visual Studio Tools 2 106
is twain_32.dll cmpatible with windows 10 ? 10 164
Better understanding on C++ Class serialization and formats 9 67
Beginner to Unreal Engine 4 5 80
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

825 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