Share via


Windows Media Player 11 SDK About the Cdrom and CdromCollection Objects 

Windows Media Player SDK banner art

Previous Next

About the Cdrom and CdromCollection Objects

The Cdrom and CdromCollection objects govern the interface to the CD drives in your computer for purposes of reading and playing CDs.

The CdromCollection object is accessed only through the cdromCollection property of the Player object. The cdromCollection property returns the CdromCollection object. You can only access the properties of the CdromCollection object after you have created it. For example, to use the count property, you must use the following code:

mycount = player.cdromcollection.count;

You can only access the Cdrom object through the CdromCollection object. For example, to eject the CD by using the Eject method, you must first create the collection object and then an item in the object. To eject the CD, use the following code:

player.cdromcollection.item(0).eject();

In both cases, you are first creating the collection object (CdromCollection) and then getting a specific object of that collection. The object is the first item in the collection, Item(0), which corresponds to the first CD drive. You then call a method, Eject, on that item.

See Also

Previous Next