February 22nd, 2003, 10:39 PM
Check for a blank CD-R inserted
Could anyone give me a clue or some example on how do i check if a blank cd is inserted in my cd/rw drive? I'm trying to write a little program where i punch F1 key, and my cd/rw opens, then msg box says insert a blank cd, then i click ok. Here i need to check if the media inserted is a valid blank cd-r. If not it would spit it out and return to the first msg box. If it's valid cd-r, it would write the specific files (listed in the masterlist file, which would be quite big) onto the cd-r, then spit it out, display message saying it's done. If error during the session, it would spit it out saying error occured, asking if i want to insert another blank cd-r and start over. While copying files to cd-r it would show the progress bar or some kind of animation of the copy process.
I've got it to the point where it hides the console, opens the cd tray, displays me the msg box to insert a blank cd-r, after clicking on OK it closes the CD/RW, and here i need to check if a cd inserted is a blank and writable cd-r disk (it won't be cd-rw).
using namespace std;
MessageBox(NULL, "Insert Blank CD", "Back-up program", MB_OK);
MessageBox(NULL, "Done! Remove a CD and click OK", "Back-up program", MB_OK);
mciSendString("set cdaudio door open",NULL,0,NULL);
mciSendString("set cdaudio door closed",NULL,0,NULL);
February 23rd, 2003, 04:14 PM
Everyone is posting all kind of answers all over this forum and couple more forums that i have searched for last few days, but as of my question - nothing. Searched all these forums with all possible keywords, but can't find anything.
Posted my question, which I thought at least few gurus would be familiar with, but only views, no replies.
I guess i'm the first and only person in the world to write the program that requires to check for a blank cd-r inserted.
I'm really frustrated right now. I don't believe no one knows at least something on this matter.
Please, if anyone could give me some kind of leads where i could find something related, it would help me alot.
January 23rd, 2004, 01:09 PM
January 23rd, 2004, 01:18 PM
I use IDiscRecorder::QueryMediaType to find if the CD is properly inserted. The returned parameter will tell you if there is a media present and what type.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.