Windows Media Player SDK banner art
PreviousNext

About the Cdrom and CdromCollection Objects

These objects govern the interface to the CD-ROM in your computer for purposes of reading and playing.

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.

PreviousNext


© 2000-2001 Microsoft Corporation. All rights reserved.