CDROM drive
-
On the shelves at your local Best Buy. :) But seriously, call GetLogicalDrives() to determine the drive letters in use, then GetDriveType() on each drive. GetDriveType() returns DRIVE_CDROM for CD-ROM drives. --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.
-
On the shelves at your local Best Buy. :) But seriously, call GetLogicalDrives() to determine the drive letters in use, then GetDriveType() on each drive. GetDriveType() returns DRIVE_CDROM for CD-ROM drives. --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.
-
This is an example: void GetCDROMDrive(void) { char buf[10]; BOOL bFind = FALSE; for (int i = 0;i < 24;i++) { if (bFind) break; sprintf(buf,"%c:\\",'C'+i); WORD type = GetDriveType(buf); switch(type) { case DRIVE_UNKNOWN: break; case DRIVE_NO_ROOT_DIR: break; case DRIVE_REMOVABLE: break; case DRIVE_FIXED: break; case DRIVE_REMOTE: break; case DRIVE_CDROM: //("CD-ROM"); lstrcpy(g_szCD_ROM,buf); break; case DRIVE_RAMDISK: break; default: break; }; } } welcome you to Sky...
-
This is an example: void GetCDROMDrive(void) { char buf[10]; BOOL bFind = FALSE; for (int i = 0;i < 24;i++) { if (bFind) break; sprintf(buf,"%c:\\",'C'+i); WORD type = GetDriveType(buf); switch(type) { case DRIVE_UNKNOWN: break; case DRIVE_NO_ROOT_DIR: break; case DRIVE_REMOVABLE: break; case DRIVE_FIXED: break; case DRIVE_REMOTE: break; case DRIVE_CDROM: //("CD-ROM"); lstrcpy(g_szCD_ROM,buf); break; case DRIVE_RAMDISK: break; default: break; }; } } welcome you to Sky...
Just a quick note about switch/case; if you've got this:
switch (x)
{
case 0:
break;
case 1:
break;
case 2:
MyFunction();
break;
case 3:
MyFunction();
break;
case 4:
MyOtherFunction();
break;
};You can write it mroe concisely as:
switch (x)
{
case 0:
case 1:
break;case 2:
case 3:
MyFunction();
break;case 4:
MyOtherFunction();
break;
};You probably already knew, but for the purposes of anyone reading it may be useful info. > Andrew.