Help and Support
 

powered byLive Search

SAMPLE: Cdplyr.exe Demonstrates Using the mciSendString Function

Article ID:181474
Last Review:March 11, 2005
Revision:2.3
This article was previously published under Q181474
On This Page

SUMMARY

Cdplyr.exe is a self-extracting executable file that contains a Visual Basic project demonstrating how to use the mciSendString API function to add multimedia capabilities to your Visual Basic program. The sample project is an audio CD player.

Back to the top

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Cdplyr.exe (http://download.microsoft.com/download/vb50pro/sample/2/win98/en-us/cdplyr.exe)
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 (http://support.microsoft.com/kb/119591/EN-US/) How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. When you run the self-extracting file, the following files are expanded into the mciSendString Sample Project directory.
CDPlyr.vbp
CDPlyr.vbw
Form1.frm
Module1.bas
Readme.txt -you are currently reading this file.
The API function mciSendString allows you to send a command string to an MCI device. You can send commands to detect an audio CD, determine the number of tracks on the disc, and play the disc at any track or time. This project shows you how to use this function in Visual Basic.

When you run the program, you must have the AutoPlay feature of the operating system disabled. Otherwise, unexpected behavior may occur.

You can disable AutoPlay by pressing the SHIFT key when inserting an audio CD or by completing the following steps.

Back to the top

To Disable AutoPlay

1.Double-click the My Computer icon.
2.On the View menu, click Options, and then click the File Types tab.
3.Click the AudioCD type, and then click Edit.
4.In the Actions list, click Play, and then click Set Default.

Back to the top

To Run the Project

These instructions assume you have disabled AutoPlay.
1.Open the project in Visual Basic.
2.On the Run menu, click Start or press the F5 key to start the program. Note that all the command buttons are disabled.
3.Put an audio CD into the CD player of your computer and note that the programs starts playing the first track in your audio CD.

Back to the top


APPLIES TO
Microsoft Visual Basic 5.0 Learning Edition
Microsoft Visual Basic 5.0 Professional Edition
Microsoft Visual Basic 5.0 Enterprise Edition
Microsoft Visual Basic 6.0 Professional Edition
Microsoft Visual Basic 6.0 Enterprise Edition

Back to the top

Keywords: 
kbhowto kbdownload kbfile kbsample kbsound KB181474

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.