Share via


Ripping by Using the IWMPCdromRip Interface

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

This section describes how to use the IWMPCdromRip interface to rip music from a CD.

Ripping a CD by using the IWMPCdromRip interface has the same effect as ripping music by using the Windows Media Player user interface. Ripped content is automatically added to the library according to the user's preferences. For more information about CD ripping, see "Ripping music from CDs" in Windows Media Player Help.

The code examples in this section use Active Template Library (ATL) classes, such as CComPtr.

Included Headers

To use the code in this section, include the following headers:

#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <commctrl.h>
#include "wmp.h"
#include "wmpids.h"

Interface Pointers

The interfaces for Windows Media Player are stored in the following member variables.

// Player interface.
CComPtr<IWMPPlayer>             m_spPlayer;

// CDROM interfaces.
CComPtr<IWMPCdromCollection>    m_spCdromCollection;
CComPtr<IWMPCdrom>              m_spCdrom;
CComPtr<IWMPCdromRip>           m_spCdromRip;
CComPtr<IWMPPlaylist>           m_spPlaylist;

The Following Sections Describe How to Use the IWMPCdromRip Interface