How to Address Multiple CDAudio Devices in Windows NTLast reviewed: October 2, 1995Article ID: Q137579 |
The information in this article applies to:
SUMMARYTo use more than one CDAudio device in Windows 3.1, you had to change the System.ini file. For more information on this process, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q82469 TITLE : Using Multiple CD-ROM Drives on One MachineNow, in Windows NT 3.5 and Windows 95, support for multiple CDAudio devices has been added to the MCI CDAudio driver. However, the problem now becomes one of how to address a particular CDAudio device.
MORE INFORMATIONMCI solves the problem of how to control a particular CDAudio device. All you need to do is open the CDAudio device, specifying the drive letter of the CD-ROM drive to be used as the element to open. The MCI string syntax to do this is as follows:
open d: type cdaudio alias cdIn this case, the CD-ROM drive is drive D: The following code fragment demonstrates the equivalent MCI command syntax code:
MCI_OPEN_PARMS mciOpen; TCHAR szElementName[4]; TCHAR szAliasName[32]; DWORD dwFlags; DWORD dwAliasCount = GetCurrentTime(); DWORD dwRet; TCHAR chDrive; chDrive = TEXT("D"); // Use drive D ZeroMemory( &mciOpen, sizeof(mciOpen) ); mciOpen.lpstrDeviceType = (LPTSTR)MCI_DEVTYPE_CD_AUDIO; wsprintf( szElementName, TEXT("%c:"), chDrive ); wsprintf( szAliasName, TEXT("CD%lu:"), dwAliasCount ); mciOpen.lpstrElementName = szElementName; mciOpen.lpstrAlias = szAliasName; dwFlags = MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE | MCI_OPEN_ALIAS | MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID | MCI_WAIT; dwRet = mciSendCommand(0, MCI_OPEN, dwFlags, (DWORD)(LPVOID)&mciOpen); if ( dwRet == MMSYSERR_NOERROR ) { // The device was opened successfully } else { // The device was not opened successfully } |
Additional reference words: 3.50 4.00 Windows 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |