porting VC++ 6.0 Application to VC++ 8.0 which uses Boost library.

I've an application running in VC++ 6.0 which is using Boost library. I tried to port this application to VC++ 8.0 but had errors in Boost library while compiling the project.
I just opened my existing project in Visual Studio 2005 and it asked to convert my VC++ 6.0 project in VC++ 8.0. That's how i converted to VC++ 8.0.
Then i tried to build my project and it started giving me errors regarding boost library.

One of the errors is as below :

d:\source code 8.5.1 - visualstudio 2005\3pty\boost\boost\iterator_adaptors.hpp(1229) : warning C4346: 'std::iterator_traits<_Iter>::value_type' : dependent name is not a type
        prefix with 'typename' to indicate a type
d:\source code 8.5.1 - visualstudio 2005\3pty\boost\boost\iterator_adaptors.hpp(1229) : error C2923: 'boost::reverse_iterator_generator' : 'std::iterator_traits<_Iter>::value_type' is not a valid template type argument for parameter 'Value'

Can anybody help me out with this? it's lil urgent.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MSDN, Compiler Warning (level 1) C4346:
The typename keyword is required if a dependent name is to be treated as a type. This is a breaking change in the Visual C++ .NET 2003 compiler, made in order to conform to the ISO C++ standard.


Take a look at C4346 description and add "typename" where it is necessary. I cannot say where exactly, because I don't see Boost code, but you can play with this. C4346 is key message here, adding "typename" solves also C2923 message.

Notice that this change is done according to C++ standard. Maybe you are using special Boost version for VC++ 6.0, which is not standard compliant, in this case you need to use other version.

q3techAuthor Commented:
Following lines compiles perfectly in VC6.0 but gives errors in VC7.1.

    COM_INTERFACE_ENTRY2(HTMLButtonElementEvents, IDHTMLEvents)

one of the errors is :

error C2440: 'static_cast' : cannot convert from 'IDHTMLEvents *' to 'HTMLElementEvents *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

can anybody suggest me what can be done?

Redefine COM_INTERFACE_ENTRY2 macro replacing static_cast with C-style cast.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

q3techAuthor Commented:
I just replaced static_cast with reinterpret_cast in "atlcom.h"  and it worked.
Is it OK OR should i redefine it somewhere else (where)?
It is better to redefine this macro locally to make your program independent from Visual Studio installation.
q3techAuthor Commented:
whar_t is defined as below:

typedef unsigned short   wchar_t; /*  Use a 2 byte definition  */

it's returniing the below error, how to fix this error :

error C2632: 'short' followed by 'wchar_t' is illegal
In C++ - Language options there is "Treat wchat_t as Built-in Type". Try to change it.
q3techAuthor Commented:
while compiling "SPI_GETFOREGROUNDLOCKTIMEOUT" is undeclared. Why is it so in VC8.0?

Windows NT and Windows 95:  This value is not supported.

For every functions or constants which are not supported in all operating systems see the following article:

BTW, I already answered 4 questions here. Maybe it is time to accept an answer and open new question if necessary?
q3techAuthor Commented:
i'm so sorry actually i'm using this site for the first time. I applied all ur answers but forgot to accept them here. thanx a lot for ur help.
q3techAuthor Commented:
can i accept all ur answers somehow? actually it's showing only "comment" written over there.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.