Share via


Windows Media Player 11 SDK Retrieving the Drive and Disc StatusĀ 

Windows Media Player SDK banner art

Previous Next

Retrieving the Drive and Disc Status

Before starting a CD burning operation, you must ensure that the selected CD-ROM drive supports the operation you want to perform. For instance, you must check that a CD is capable of being erased before calling IWMPCdromBurn::erase. The following code shows an example of using IWMPCdromBurn::isAvailable to determine whether an operation is supported:

VARIANT_BOOL vbResult;
    
// Check whether this drive can burn CDs.
CComBSTR bstrItem;
HRESULT hr = bstrItem.Append("Burn");
if (SUCCEEDED(hr))
{
    hr = m_spCdromBurn->isAvailable(bstrItem, &vbResult);
}
if (SUCCEEDED(hr))
{
    if (VARIANT_TRUE == vbResult)
    {
        // The current drive can burn CDs.
    }
}

See Also

Previous Next