Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compile error with shlobj.h

Status
Not open for further replies.

inetd

Technical User
Jan 23, 2002
115
0
0
HK
When I include the shlobj.h in my cpp file, there is always a compile error with:
"Multiple declaration for FVSHOWINFO"
"Earlier declaration for FVSHOWINFO"
"Multiple declaration for FOLDERSETTINGS"
"Earlier declaration for FOLDERSETTINGS"
....
....
....

What does it mean? How can fix it?
I have not written any code in the unit but it also generate the above error if including the shlobj.h.

I am using Borland C++ Builder 5 Professional Edition.

Anyone can give me a hint?

Thanks.

 
FVSHOWINFO and FOLDERSETTINGS are varibles that are declared multiple times. For example,
Code:
bool FVSHOWINFO;
string FOLDERSETTINGS;
.
.
.
for (int j = 0; j < ANumber; j++)
{
    bool FVSHOWINFO; // Error
    string FOLDERSETTINGS; // Error
}

You will have to look carefully in the header file for the declartions for these varables.

James P. Cottingham
[sup]
There's no place like 127.0.0.1.
There's no place like 127.0.0.1.
[/sup]
 
I think it is because you should not include this file directly. You should use some other .h which includes this one.

Ion Filipski
1c.bmp
 
I don't know what caused this problem but if you want to avoid it you must add at beginning of cpp file this:

#define NO_WIN32_LEAN_AND_MEAN

I'm sure it will work.
 
Thanks domainochmiel,

After I post the question, I have found a example that also uses shlobj.h and it has mentioned that:

#define NO_WIN32_LEAN_AND_MEAN

should be in the first line of the cpp unit file.

I have tried it and it works.

Anyway, thanks to everybody.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top