Click here to Skip to main content
15,923,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: unicode help Pin
Nishad S15-Oct-07 1:43
Nishad S15-Oct-07 1:43 
AnswerRe: unicode help Pin
Alex Cohn16-Oct-07 2:29
Alex Cohn16-Oct-07 2:29 
GeneralRe: unicode help Pin
Nishad S16-Oct-07 2:38
Nishad S16-Oct-07 2:38 
Questiondisplaying the directories on a combo box Pin
Chandrasekharan P15-Oct-07 0:17
Chandrasekharan P15-Oct-07 0:17 
AnswerRe: displaying the directories on a combo box Pin
chandu00415-Oct-07 0:26
chandu00415-Oct-07 0:26 
AnswerRe: displaying the directories on a combo box Pin
Nibu babu thomas15-Oct-07 0:29
Nibu babu thomas15-Oct-07 0:29 
AnswerRe: displaying the directories on a combo box Pin
Nishad S15-Oct-07 1:05
Nishad S15-Oct-07 1:05 
GeneralRe: displaying the directories on a combo box Pin
revanth198515-Oct-07 1:16
revanth198515-Oct-07 1:16 
use the following code.Here m_letter is the member variable of combo box.

int k = 0;
DWORD MaxDriveSet, CurDriveSet;
DWORD drive, drivetype;
TCHAR szBuf[300];
HANDLE hDevice;
PSTORAGE_DEVICE_DESCRIPTOR pDevDesc;

for(k=0; k<26; k++)
szMoveDiskName[k] = '\0';
k = 1;
// Get available drives we can monitor
MaxDriveSet = CurDriveSet = 0;

MaxDriveSet = GetLogicalDrives();
CurDriveSet = MaxDriveSet;
for ( drive = 0; drive < 32; ++drive )
{
if ( MaxDriveSet & (1 << drive) )
{
DWORD temp = 1<<drive;
_stprintf(="" szdrvname,="" _t("%c:"),="" 'a'+drive="" );
="" m_letter.addstring(szdrvname);

="" switch="" (="" getdrivetype(="" szdrvname="" )=""
="" {
="" case="" 0:="" the="" drive="" type="" cannot="" be="" determined.
="" 1:="" root="" directory="" does="" not="" exist.
="" drivetype="DRVUNKNOWN;
" break;
="" drive_removable:="" can="" removed="" szmovediskname[k]="chFirstDriveFromMask(temp);
" szmovediskname[0]="k;
" k++;
="" drive_cdrom:="" is="" a="" cd-rom="" drive.
="" drive_fixed:="" disk="" sprintf(szbuf,="" "\\\\?\\%c:",="" 'a'+drive);
="" hdevice="CreateFile(szBuf," generic_read,
="" file_share_read="" |="" file_share_write,="" null,="" open_existing,="" null);

="" if="" (hdevice="" !="INVALID_HANDLE_VALUE)
" {

="" pdevdesc="(PSTORAGE_DEVICE_DESCRIPTOR)new" byte[sizeof(storage_device_descriptor)="" +="" 512="" -="" 1];

="" pdevdesc-="">Size = sizeof(STORAGE_DEVICE_DESCRIPTOR) + 512 - 1;

if(GetDisksProperty(hDevice, pDevDesc))
{
if(pDevDesc->BusType == BusTypeUsb)
{
szMoveDiskName[k] = chFirstDriveFromMask(temp);
szMoveDiskName[0]=k;
k++;
}
}

delete pDevDesc;
CloseHandle(hDevice);
}

break;
case DRIVE_REMOTE:// The drive is a remote
drivetype = DRVREMOTE;
szMoveDiskName[k] = chFirstDriveFromMask(temp);
szMoveDiskName[0]=k;
k++;
break;
case DRIVE_RAMDISK:// The drive is a RAM disk.
drivetype = DRVRAM;
break;
}
}
}
GeneralRe: displaying the directories on a combo box Pin
Nishad S15-Oct-07 1:23
Nishad S15-Oct-07 1:23 
GeneralRe: displaying the directories on a combo box Pin
Chandrasekharan P15-Oct-07 1:46
Chandrasekharan P15-Oct-07 1:46 
GeneralRe: displaying the directories on a combo box Pin
revanth198515-Oct-07 1:59
revanth198515-Oct-07 1:59 
GeneralRe: displaying the directories on a combo box Pin
Nishad S15-Oct-07 2:04
Nishad S15-Oct-07 2:04 
GeneralRe: displaying the directories on a combo box Pin
Chandrasekharan P15-Oct-07 2:05
Chandrasekharan P15-Oct-07 2:05 
GeneralRe: displaying the directories on a combo box Pin
Nishad S15-Oct-07 2:02
Nishad S15-Oct-07 2:02 
GeneralRe: displaying the directories on a combo box Pin
Chandrasekharan P15-Oct-07 2:06
Chandrasekharan P15-Oct-07 2:06 
GeneralRe: displaying the directories on a combo box Pin
Nishad S15-Oct-07 2:14
Nishad S15-Oct-07 2:14 
GeneralRe: displaying the directories on a combo box Pin
Chandrasekharan P15-Oct-07 2:09
Chandrasekharan P15-Oct-07 2:09 
GeneralRe: displaying the directories on a combo box Pin
Nishad S15-Oct-07 2:20
Nishad S15-Oct-07 2:20 
GeneralRe: displaying the directories on a combo box Pin
David Crow15-Oct-07 4:02
David Crow15-Oct-07 4:02 
GeneralRe: displaying the directories on a combo box Pin
Nishad S15-Oct-07 18:10
Nishad S15-Oct-07 18:10 
GeneralRe: displaying the directories on a combo box Pin
David Crow15-Oct-07 4:03
David Crow15-Oct-07 4:03 
AnswerRe: displaying the directories on a combo box Pin
David Crow15-Oct-07 3:59
David Crow15-Oct-07 3:59 
GeneralRe: displaying the directories on a combo box Pin
Chandrasekharan P15-Oct-07 6:55
Chandrasekharan P15-Oct-07 6:55 
QuestionRe: displaying the directories on a combo box Pin
David Crow15-Oct-07 7:18
David Crow15-Oct-07 7:18 
Questionhistory Pin
revanth198515-Oct-07 0:08
revanth198515-Oct-07 0:08 

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.