BUG: Opening an AVI file Fails When MCIWnd Is Subclassed

Last reviewed: November 30, 1995
Article ID: Q140108
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1
  • Microsoft Video for Windows Development Kit version 1.1

SYMPTOMS

In an application based on Windows 3.1 where an MCIWnd window is subclassed (using SetWindowLong API) and an AVI file is opened by MCIWndOpen macro, if the window is closed (for example, by double-clicking System Menu Box), then no AVI files may be opened in any MCIWnd window created thereafter. Specifically, MCIWndOpen returns MCI error code 289 on subsequent calls.

RESOLUTION

The subclassed window can process a WM_CLOSE message to set the original MCIWnd window procedure back and then forward this message to the original window procedure as in this sample code:

   WM_CLOSE: SetWindowLong(hsubMCIWnd, GWL_WNDPROC, (DWORD)lpfnOldWndProc);
             return CallWindowProc(lpfnOldWndProc, hsubMCIWnd,
             message, wParam, lParam);
            // lpfnOldWndProc points to the original MCIWnd procedure

STATUS

Microsoft has confirmed this to be a bug in the products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: 3.10 MCIWndCreate MCI MCIAVI alias used unique
KBCategory: kbmm kbbuglist
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: November 30, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.