Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading a CD

Status
Not open for further replies.

cyprus106

Programmer
Apr 30, 2001
654
How do i read a CD to find the serial number and find out whether or not it is an audio CD or a Data Disk? i cant seem to get a grasp on it and i desperately need to find out how...thanks to anyone who'll help,

Cyprus Cyprus
 
something i left out:

im using BCB5 and running an application, for what its worth. Cyprus
 
this shows some of the information you need:

void __fastcall TForm1::Button1Click(TObject *Sender) {
unsigned long r = GetDriveType( "E:\\" );
switch( r ) {
case 2:
Label1->Caption = "Removable drive";
break;
case 3:
Label1->Caption = "Fixed drive";
break;
case 4:
Label1->Caption = "Remote";
break;
case 5:
char buf[512];
unsigned long sn;
char vn[255];
char fs[255];
if( GetVolumeInformation( "E:\\", vn, 255, &sn, 0, 0, fs, 255 ) ) {
sprintf( buf, "CD-Rom, vol. name: %s, File system: %s, serial no: %d", vn,fs,sn );
Label1->Caption = buf;
} else {
Label1->Caption = "CD-Rom drive empty";
}
break;
case 6:
Label1->Caption = "Ram disk";
break;
default:
Label1->Caption = "Unknown";
break;
}
}

to get more details you have to implement the micro$oft multimedia control. I have not tested this control but msdn tells us that it has a mediatype property

succes,
hennie peters
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top