shlobj.h编译出错的解决方法!

 

 

Be sure to include the following header in the COM object header file:

#include <shlobj.h>

Now you find out if you need to makes some changes before continuing. Hit build and you may likely be greeted with some error messages.

> [C++ Error] shlobj.h(1762): E2238 Multiple declaration for 'FVSHOWINFO'
> [C++ Error] shlobj.h(1936): E2238 Multiple declaration for 'FOLDERSETTINGS'
> [C++ Error] shlobj.h(3717): E2238 Multiple declaration for 'DESKBANDINFO'
> [C++ Error] shlobj.h(4808): E2238 Multiple declaration for 'SHELLFLAGSTATE'

This problem is addressed in the upd1rdme.txt file in the builder directory, which appears after applying the service pack. For what it's worth, I have never tried the solution suggested in the upd1rdme.txt file. I simply commented the areas out of the ShlObj.hpp. Later I would read a post by Alex Bakaev [Team B] in borland.public.cppbuilder.activex that suggested commenting out the offending parts from the ShlObj.hpp file also. So there you have it. Someone in the know also suggests the "comment it out" solution. Great minds think alike, and all that.

The following code was all that I commented out of ShlObj.hpp to get the project to build.

//typedef FVSHOWINFO *PFVShowInfo;
//typedef FVSHOWINFO  TFVShowInfo;
//typedef FOLDERSETTINGS *PFolderSettings;
//typedef FOLDERSETTINGS  TFolderSettings;
...
//typedef DESKBANDINFO *PDeskBandInfo;
//typedef DESKBANDINFO  TDeskBandInfo;
...
//typedef SHELLFLAGSTATE *PShellFlagState;
//typedef SHELLFLAGSTATE  TShellFlagState;

As I said, I commented the areas out of the ShlObj.hpp file. You can do the same, or you can try the solution in the upd1rdme.txt file. I know at least one of them works for sure.

After you have made the changes the project should now build. Of course , it does nothing of any use to us yet. But building the project is always an accomplishment in C++, so you might as well celebrate this small victory.

 

另:shobjidl.h也出过错,我用安装文件中的同名文件替换当前文件.解决了.怀疑是之前改动过了.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值