Click here to Skip to main content
16,016,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to use a class to be a utility class of another class? Pin
knightz10119-Oct-05 6:29
knightz10119-Oct-05 6:29 
AnswerRe: how to use a class to be a utility class of another class? Pin
Maximilien19-Oct-05 6:50
Maximilien19-Oct-05 6:50 
AnswerRe: how to use a class to be a utility class of another class? Pin
Bob Stanneveld19-Oct-05 8:12
Bob Stanneveld19-Oct-05 8:12 
QuestionLooking for scheduling control (Outlook2003 like) Pin
TheDen19-Oct-05 5:32
TheDen19-Oct-05 5:32 
AnswerRe: Looking for scheduling control (Outlook2003 like) Pin
S Douglas20-Oct-05 0:13
professionalS Douglas20-Oct-05 0:13 
QuestionHow to determine hard drives? Pin
wasife19-Oct-05 4:28
wasife19-Oct-05 4:28 
AnswerRe: How to determine hard drives? Pin
David Crow19-Oct-05 4:40
David Crow19-Oct-05 4:40 
AnswerRe: How to determine hard drives? Pin
Anehl19-Oct-05 4:44
Anehl19-Oct-05 4:44 
You can use _getdrives() and others directories routines

Example of msdn

/* GETDRIVE.C illustrates drive functions including:
* _getdrive _chdrive _getdcwd
*/

#include <stdio.h>
#include <conio.h>
#include <direct.h>
#include <stdlib.h>
#include <ctype.h>

void main( void )
{
int ch, drive, curdrive;
static char path[_MAX_PATH];

/* Save current drive. */
curdrive = _getdrive();

printf( "Available drives are: \n" );

/* If we can switch to the drive, it exists. */
for( drive = 1; drive <= 26; drive++ )
if( !_chdrive( drive ) )
printf( "%c: ", drive + 'A' - 1 );

while( 1 )
{
printf( "\nType drive letter to check or ESC to quit: " );
ch = _getch();
if( ch == 27 )
break;
if( isalpha( ch ) )
_putch( ch );
if( _getdcwd( toupper( ch ) - 'A' + 1, path, _MAX_PATH ) != NULL )
printf( "\nCurrent directory on that drive is %s\n", path );
}

/* Restore original drive.*/
_chdrive( curdrive );
printf( "\n" );
}

Output
Available drives are:
A: B: C: L: M: O: U: V:
Type drive letter to check or ESC to quit: c
Current directory on that drive is C:\CODE

Type drive letter to check or ESC to quit: m
Current directory on that drive is M:\

Type drive letter to check or ESC to quit:
QuestionSoundcard VU Meter Pin
69 Bay19-Oct-05 2:24
69 Bay19-Oct-05 2:24 
Questionapi subversion Pin
Anehl19-Oct-05 1:45
Anehl19-Oct-05 1:45 
QuestionRe: api subversion Pin
David Crow19-Oct-05 3:15
David Crow19-Oct-05 3:15 
AnswerRe: api subversion Pin
Anehl19-Oct-05 3:36
Anehl19-Oct-05 3:36 
QuestionRe: api subversion Pin
David Crow19-Oct-05 3:39
David Crow19-Oct-05 3:39 
AnswerRe: api subversion Pin
Maximilien19-Oct-05 3:55
Maximilien19-Oct-05 3:55 
GeneralRe: api subversion Pin
David Crow19-Oct-05 4:04
David Crow19-Oct-05 4:04 
AnswerRe: api subversion Pin
Anehl19-Oct-05 3:56
Anehl19-Oct-05 3:56 
GeneralRe: api subversion Pin
Cedric Moonen19-Oct-05 4:02
Cedric Moonen19-Oct-05 4:02 
GeneralRe: api subversion Pin
David Crow19-Oct-05 4:09
David Crow19-Oct-05 4:09 
GeneralRe: api subversion Pin
Anehl19-Oct-05 4:26
Anehl19-Oct-05 4:26 
AnswerRe: api subversion Pin
vikas amin19-Oct-05 4:26
vikas amin19-Oct-05 4:26 
GeneralRe: api subversion Pin
David Crow19-Oct-05 4:37
David Crow19-Oct-05 4:37 
GeneralRe: api subversion Pin
Anehl19-Oct-05 4:37
Anehl19-Oct-05 4:37 
AnswerRe: api subversion Pin
Bob Stanneveld19-Oct-05 5:19
Bob Stanneveld19-Oct-05 5:19 
AnswerRe: api subversion Pin
S Douglas20-Oct-05 0:24
professionalS Douglas20-Oct-05 0:24 
QuestionExchange data between PropertyPages Pin
emma200019-Oct-05 1:26
emma200019-Oct-05 1:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.