Microsoft KB Archive/132966

From BetaArchive Wiki

PRB: BSTR Redefinition If SHLOBJ.H Included in MFC Apps

Q132966



The information in this article applies to:


  • Microsoft Win32 Software Development Kit (SDK) on the following platform:
  • Microsoft Windows 95





SYMPTOMS

When you include SHLOBJ.H in an MFC application, the following compiler error occurs:

error C2371: 'BSTR' : redefinition



CAUSE

The SDK header file OAIDL.H and the MFC library both define a type BSTR.



RESOLUTION

To work around this problem, add the following definition before including any MFC headers. In an AppWizard-generated application this can be done at the beginning of the STDAFX.H include file:

   #define _AFX_NO_BSTR_SUPPORT 

Additional query words: MFC BSTR

Keywords : kbMFC kbOSWin95
Issue type : kbprb
Technology : kbWin95search kbWin95


Last Reviewed: December 15, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.