简体   繁体   中英

VS 2008 atlcom.h ClassesAllowedInStream not defined (cannot convert parameter)

I am trying to build a project in VC++2008 and it is giving the following error:

error C2664: 'HRESULT ATL::CComVariant::ReadFromStream
(IStream *,VARTYPE,ATL::ClassesAllowedInStream,DWORD)' :
cannot convert parameter 3 from 'const int' to 'ATL::ClassesAllowedInStream'
c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h
6054

Can anyone help?

This is an error that stems from a bug in the VS2008 Service Pack 1 installation. I had the same problem.

A workaround for me was to reinstall VS 2008 (setup option "repair/clean new install") and then immediately install SP1.

The bug occurs if a Windows SDK is installed between the installation of VS2008 and SP1. In this case, the VS2008 SP1 installation updates the file atlcom.h , but fails to update its included file atlcomcli.h accordingly, thus ClassesAllowedInStream is undefined.

See the discussions on MSDN Social and in this mailing list .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM