MCI, MMTASK, and Multiple AVI Files

Last reviewed: March 2, 1996
Article ID: Q147768
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) version 3.1

SUMMARY

The Media Control Interface (MCI) command set permits applications to open, playback and close multiple AVI files simultaneously but careful attention must be made to the order of the corresponding CLOSE commands.

MORE INFORMATION

Behind the scenes of Windows, each OPEN call creates an instance of MMTASK. MMTASK provides simulated multitasking for multimedia applications, with each copy of MMTASK "chained" to the previous. Should the chain be broken incorrectly by destroying each instance of MMTASK with the CLOSE command, the system will be left unstable. Closing the files in the reverse order destroys the chain correctly.

The following sequence demonstrates the correct approach:

   open movie1.avi alias m1
   open movie2.avi alias m2
   open movie3.avi alias m3
   open movie4.avi alias m4
   .
   .
   .
   close m4 notify
   close m3 notify
   close m2 notify
   close m1 notify

The notify flag is included to allow an application to determine when each instance of MMTASK has been destroyed.


Additional reference words: 3.10 MULTIMEDIA AVI VIDEO MCI MMTASK MCI_OPEN
MCI_CLOS E NOTIFY
KBCategory: kbmm kbprg
KBSubcategory: MMVideo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 2, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.