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

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

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也出过错,我用安装文件中的同名文件替换当前文件.解决了.怀疑是之前改动过了.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航