Microsoft KB Archive/131632

= How to Play Audio CDs from Visual FoxPro =

Article ID: 131632

Article Last Modified on 8/3/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q131632



SUMMARY
This article shows by example how to play an audio compact disc (CD) using Visual FoxPro.



MORE INFORMATION
The following example registers the Windows Multi-Media DLL file (WINMM.DLL) by using the DECLARE command. WINMM.DLL contains the MciSendString system function that accepts parameters to allow you to manipulate media files and devices.

Step-by-Step Example
  Create a new form and enter the following code in the Init section of the form: #define mmsystem "WINMM.DLL" DECLARE integer mciSendString IN mmsystem string, string, integer,; integer =mciSendString("open cdaudio","",0,0)   Add a command button to the form, and set its Caption property to Play. Enter the following code in the Click event of the button: =mciSendString("play cdaudio","",0,0)   Add another command button to the form, and set its Caption property to Stop. Enter the following code in the Click event of the button: =mciSendString("stop cdaudio","",0,0)   Add another command button to the form, and set its Caption property to Eject. Enter the following code in the Click event of the button: =mciSendString("set cdaudio door open","",0,0)   Add a final command button to the form, and set its Caption property to Exit. Enter the following code in the Click event of the button: CLEAR DLLS RELEASE THISFORM  Press the exclamation mark (!) button on the Visual FoxPro toolbar, and enter a name for the form.</ol>

Additional query words: kbsound VFoxWin CD-ROM sound music akz

Keywords: KB131632

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.