Bring the appropriate multimedia files into your resource file as shown below:

#include <os2medef.h>
RESOURCE RT_WAVE IDR_WAVE "zipper.wav"
RESOURCE RT_RMID IDR_MIDI "bach.mid"
RESOURCE RT_AVI  IDR_ULT "\\mmos2\\movies\\macaw.avi"
RESOURCE RT_RIFF IDR_WAVE "zipper.wav"
RESOURCE RT_RIFF IDR_MIDI "bach.mid"
RESOURCE RT_RIFF IDR_ULT "macaw.avi"

The RT_* values are the "resource types" and the IDR_* values are the resource identifiers you provide. Refer to the PM Programming Guide and Reference for detailed information on creating resource files.

You can then use mciPlayResource to play a multimedia resource through the media control interface as shown below:

#define INCL_MACHDR
#define INCL_MCIOS2
#include <os2me.h>
rc = mciPlayResource( hwnd,       /* Window handle */
                      hmod,       /* Resource module handle or 0 for EXE */
                      RT_WAVE,    /* Resource type */
                      IDR_WAVE,   /* Resource ID */
                      ulFlags,
                      szTitle,    /* Other API values */
                      hwndClient);


[Back] [Next]