The DVD burner functionality makes it possible to burn ISO and DVD images or regular data folders on recordable and writable media.
To begin burning, follow the steps:
Create an instance of the LTDVDBurner object.
C Source
ILTDVDBurner * pBurner;
CoCreateInstance
(CLSID_LTDVDBurner, NULL, LSCTX_INPROC_SERVER, IID_ILTDVDBurner, (void**)& pBurner);
ILTDVDBurner * pBurner;
CoCreateInstance
(CLSID_LTDVDBurner, NULL, LSCTX_INPROC_SERVER, IID_ILTDVDBurner, (void**)& pBurner);
The burner object can burn an ISO/DVD image or regular data folder (for example, a DVD at C:\DVDImage or an ISO file at "C:\ISOFile\Image.iso").
Eject the drive tray and insert the empty disc:
C Source
ILTDVDBurner_EjectDisc (pBurner);
pBurner->EjectDisc ();
Load the tray:
C Source
ILTDVDBurner_LoadDisc (pBurner);
pBurner->LoadDisc ();
Associate the DVD image path, ISO file or regular data folder to the burner object:
C Source
//For the DVD image
ILTDVDBurner_put_InputPath (pBurner ,L" C:\\DVDImage");
//For the ISO file
ILTDVDBurner_put_InputPath (pBurner ,L"C:\\ISOFile\\Image.iso");
//For the DVD Image
pBurner->put_InputPath (L" C:\\DVDImage");
//For the ISO file
pBurner->put_InputPath (L"C:\\ISOFile\\Image.iso");
Set the Volume name for the disc:
C Source
ILTDVDBurner_put_VolumeName (pBurner,L"DRIVE-1");
pBurner->put_VolumeName (L"DRIVE-1");
Retrieve the available speeds for the drive and the empty target disk:
C Source
Long lCount = 0 ;
BSTR bstr = NULL;
ILTDVDBurner_RefreshSpeedList (pBurner);
// Get the number of available speeds
ILTDVDBurner_get_SpeedCount (pBurner, & lCount);
// For each index value, retrieve the name of the speed
// Use this feature to display the names of the available speeds.
For(long i = 0; i < lCount ; i++)
{
ILTDVDBurner_GetSpeedName (pBurner, i, &bstr);
// Do something with the name.
// Free the name after you finish using it
SysFreeString(bstr);
}
Long lCount = 0 ;
BSTR bstr = NULL;
pBurner ->RefreshSpeedList ();
// Get the number of available speeds
pBurner ->get_SpeedCount (& lCount);
// For each index value, retrieve the name of the speed
// Use this feature to display the names of the available speeds.
For(long i = 0 ; i <lCount ; i++)
{
pBurner ->GetSpeedName (i, &bstr);
// Do something with the name
// Free the name after you finish using it
SysFreeString(bstr);
}
Select the burning speed:
C Source
//Select the speed that you want
ILTDVDBurner_put_CurrentSpeed (pBurner, lCount - 1);
//Select the speed that you want
pBurner ->put_CurrentSpeed (lCount - 1);
Erase the disc if it is required and if the disc is an erasable type:
C Source
VARIANT_BOOL eraseable;
ILTDVDBurner_get_Eraseable (pBurner, &eraseable);
If (eraseable == VARIANT_TRUE)
ILTDVDBurner_Erase (pBurner);
VARIANT_BOOL eraseable;
pBurner ->get_Eraseable ( &eraseable);
If (eraseable == VARIANT_TRUE)
pBurner ->Erase ();
Test the burning process, if it is required. Testing the burning process is a simulation of the burning process but without a real burning of the disc. It is much safer when you use a high speed with certain types of discs:
C Source
VARIANT_BOOL testwriteable;
ILTDVDBurner_get_TestWriteable (pBurner, & testwriteable);
If (testwriteable== VARIANT_TRUE)
ILTDVDBurner_TestWrite (pBurner);
VARIANT_BOOL testwriteable;
pBurner ->get_TestWriteable ( & testwriteable);
If (testwriteable== VARIANT_TRUE)
pBurner ->TestWrite ();
Now, start burning:
C Source
ILTDVDBurner_Write (pBurner);
pBurner ->Write ();