Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Req Is : I need to check if CD/DVD RW is having data, if yes need to delete data and write on it new data after deletion.
I am able to delete data but not able to write after that.

Please provide a sample code in C++ for deletion and burning CD/DVD using IMAPI 2.0.

What I have tried:

I created a method EraseMedia() -- with intialize, Discmaster initialize, recorder initialize , accquire access, DiscFormatErase intialize with recorder, erase data, release recorder.

Created a WriteMedia() -- with intialize, Discmaster initialize, recorder initialize , accquire access , datastream initialize and write.

Issues :
-- When i am executing separtely only the writemethod , it writes perfectly on the DVD/CD.
-- When i am executing separately only erase method, erases all data perfectly.
-- When i call in main method -- first erase method & then write method.
It executes erase perfectly but before writing only throws error. Doesnt write on CD/DVD
Posted
Updated 18-Jul-16 19:28pm
v2

1 solution

Um...CD and DVD are not re-writable devices: once you write to the physical media that's it, it can't be changed subsequently, even with a burner (That's not quite true, IIRC you can change 0s to 1s but not 1s to 0s - or vice versa, I can't remember offhand)
You can if they are CDRW or DVDRW but you can't do it with standard CD's and DVD's.
 
Share this answer
 
Comments
Member 12373848 15-Jul-16 6:38am    
Yes I meant CDRW & DVDRW only. Please give me some sample or guidance how to erase data and after that write on it.
Member 12373848 18-Jul-16 4:44am    
Please guide for the above issue, its really urgent for me. Thanks in advance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900