home *** CD-ROM | disk | FTP | other *** search
File List | 1988-08-11 | 3.7 KB | 104 lines |
-
-
- PAGE 1
- 08-01-88
- 10:22:24
-
- Line# Source Line Microsoft C Compiler Version 5.10
-
- 1 /*
- 2 * OpenSound
- 3 *
- 4 * This program demonstrates the use of the function OpenSound.
- 5 * This function opens access to the play device ande prevents subseq
- uent
- 6 * opening of the device by other applications. This function has no
-
- 7 * parameters.
- 8 *
- 9 */
- 10
- 11 #include "windows.h"
- 12
- 13 int sprintf (PSTR, PSTR, int);
- 14
- 15 int PASCAL WinMain (hInstance, hPrevInstance, lpszCmdLine, cmdShow
- )
- 16 HANDLE hInstance, hPrevInstance;
- 17 LPSTR lpszCmdLine;
- 18 int cmdShow;
- 19 {
- 20 short nVoices;
- 21 char szBuffer[30];
- 22
- 23 nVoices = OpenSound (); /* Opens access to the play device and pre
- vents
- 24 * subsequent opening of the device by oth
- er
- 25 * applications. Return value specifies t
- he
- 26 * number of voices available. */
- 27
- 28 CloseSound (); /* CloseSound must be invoked to allow other applica
- tions
- 29 * to access the play device */
- 30
- 31 /* return code for OpenSound routine */
- 32 if (nVoices == S_SERDVNA)
- 33 {
- 34 MessageBox (NULL, (LPSTR)"Play device in use",
- 35 (LPSTR)"Done", MB_OK);
- 36 }
- 37 else if (nVoices == S_SEROFM)
- 38 {
- 39 MessageBox (NULL, (LPSTR)"Insufficient memory available",
- 40 (LPSTR)"Done", MB_OK);
- 41 }
- 42 else
- 43 {
- 44 sprintf (szBuffer, "%d voice (s) are available", nVoices);
- 45 MessageBox (GetFocus (), (LPSTR)szBuffer,
- 46 (LPSTR)"Done", MB_OK);
- 47 }
- 48 return 0;
- 49 }
-
-
- PAGE 2
- 08-01-88
- 10:22:24
-
- Microsoft C Compiler Version 5.10
-
-
-
- WinMain Local Symbols
-
- Name Class Type Size Offset Register
-
- nVoices . . . . . . . . . auto -0020
- szBuffer. . . . . . . . . auto -001e
- cmdShow . . . . . . . . . param 0004
- lpszCmdLine . . . . . . . param 0006
- hPrevInstance . . . . . . param 000a
- hInstance . . . . . . . . param 000c
-
-
- Global Symbols
-
- Name Class Type Size Offset
-
- CloseSound. . . . . . . . extern far function *** ***
- GetFocus. . . . . . . . . extern far function *** ***
- MessageBox. . . . . . . . extern far function *** ***
- OpenSound . . . . . . . . extern far function *** ***
- WinMain . . . . . . . . . global near function *** 0000
- pLocalHeap. . . . . . . . common near pointer 2 ***
- sprintf . . . . . . . . . extern near function *** ***
-
- Code size = 0094 (148)
- Data size = 005b (91)
- Bss size = 0000 (0)
-
- No errors detected
-