q3tech
asked on
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\iter ator_adapt ors.hpp(12 29) : warning C4346: 'std::iterator_traits<_Ite r>::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\iter ator_adapt ors.hpp(12 29) : error C2923: 'boost::reverse_iterator_g enerator' : 'std::iterator_traits<_Ite r>::value_ type' is not a valid template type argument for parameter 'Value'
Can anybody help me out with this? it's lil urgent.
thx.
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\iter
prefix with 'typename' to indicate a type
d:\source code 8.5.1 - visualstudio 2005\3pty\boost\boost\iter
Can anybody help me out with this? it's lil urgent.
thx.
ASKER
Following lines compiles perfectly in VC6.0 but gives errors in VC7.1.
BEGIN_COM_MAP(CDHTMLEvents )
COM_INTERFACE_ENTRY2(HTMLE lementEven ts, IDHTMLEvents)
COM_INTERFACE_ENTRY2(HTMLA nchorEvent s, IDHTMLEvents)
COM_INTERFACE_ENTRY2(HTMLB uttonEleme ntEvents, IDHTMLEvents)
COM_INTERFACE_ENTRY(IDispa tch)
COM_INTERFACE_ENTRY(IDHTML Events)
END_COM_MAP()
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?
thx.
BEGIN_COM_MAP(CDHTMLEvents
COM_INTERFACE_ENTRY2(HTMLE
COM_INTERFACE_ENTRY2(HTMLA
COM_INTERFACE_ENTRY2(HTMLB
COM_INTERFACE_ENTRY(IDispa
COM_INTERFACE_ENTRY(IDHTML
END_COM_MAP()
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?
thx.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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)?
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.
ASKER
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
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.
ASKER
while compiling "SPI_GETFOREGROUNDLOCKTIME OUT" is undeclared. Why is it so in VC8.0?
SystemParametersInfo(SPI_G ETFOREGROU NDLOCKTIME OUT, 0, (LPVOID)&dwTimeOut,SPIF_SE NDWININICH ANGE | SPIF_UPDATEINIFILE);
SystemParametersInfo(SPI_G
SPI_GETFOREGROUNDLOCKTIMEO UT
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:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/using_the_windows_headers.asp
BTW, I already answered 4 questions here. Maybe it is time to accept an answer and open new question if necessary?
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:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/using_the_windows_headers.asp
BTW, I already answered 4 questions here. Maybe it is time to accept an answer and open new question if necessary?
ASKER
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.
ASKER
can i accept all ur answers somehow? actually it's showing only "comment" written over there.
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.
http://msdn2.microsoft.com/en-us/library/tsx7wabs.aspx
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.