FIX: Error C2664 'AVIFileCreateStream' from Visual C++ 2.0/2.1

Last reviewed: October 29, 1997
Article ID: Q139825
4.00      | 3.50 3.51 2.00 2.10
WINDOWS   | WINDOWS NT
kbmm kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft Win32 Software Development Kit (SDK) versions 3.5, 3.51, 4.0
  • Microsoft Visual C++, 32-bit Edition, versions 2.0 and 2.1

SYMPTOMS

The following error is generated when you compile an application under Visual C++ version 2.0 or 2.1 that calls AVIFileCreateStream() and does not use UNICODE:

   error C2664: 'AVIFileCreateStream' : cannot convert parameter 3 from
                'struct _AVISTREAMINFOA*' to 'struct _AVISTREAMINFOW*'

CAUSE

The Vfw.h header file from Visual C++ version 2.0 or 2.1 has the following declaration for the AVIFileCreateStream() function:

STDAPI AVIFileCreateStream(PAVIFILE pfile,

            PAVISTREAM FAR *ppavi,
                           AVISTREAMINFOW FAR *psi);

Note the wide version of the structure in the third parameter: AVISTREAMINFOW. There is no ANSI declaration for this function in vfw.h. The header file is incorrect. It should list an ANSI version of the function that takes an ANSI AVISTREAMINFO in addition to the UNICODE version.

STATUS

Microsoft has confirmed this to be a bug in Visual C++ versions 2.0 and 2.1. This bug was corrected in Visual C++ version 2.2. The Vfw.h header file from that product declares an AVIFileCreateStreamA() function in addition to the W variety, AVIFileCreateStreamW().


Additional reference words: 3.50 2.10 2.00 4.00 Windows 95
KBCategory: kbmm kbprg kbfixlist kbbuglist
KBSubcategory: MMVideo
Keywords : MMVideo kbbuglist kbfixlist kbmm kbprg
Version : 4.00 | 3.50 3.51 2.00 2.10
Platform : NT WINDOWS
Solution Type : kbfix


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: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.