mfc >> Porting to Vc7 - BUTTON_IMAGELIST

by enrio » Thu, 27 Nov 2003 11:25:44 GMT

Hello,

I am trying to recompile a small application written for VS6
using VS.net. It is not mine, but it supposedly compiled
flawlessly under VS6.

I get the folowing error message:

c:\Program Files\Microsoft Visual Studio
.NET\Vc7\atlmfc\include\afxwin.h(2934): error C2061: syntax error :
identifier 'PBUTTON_IMAGELIST'

Searching around for where this datatype is defined, I find it in

c:\Program Files\Microsoft Visual Studio
.NET\Vc7\PlatformSDK\CommCtrl.h,

but I have a feeling that just including this file somewhere in
the source is not what I am supposed to do.

I have Googled for 'PBUTTON_IMAGELIST', no hits. It appears that
I am the only one seeing this problem.

The file that gets this error is StdAfx.cpp, which contains nothing
but:
#include "stdafx.h".

This file essentially goes
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows
headers
#include <afxwin.h>

How is this supposed to work?

Thanks, Enrique


mfc >> Porting to Vc7 - BUTTON_IMAGELIST

by David Lowndes » Thu, 27 Nov 2003 15:42:38 GMT


>c:\Program Files\Microsoft Visual Studio

Enrique,

Why don't you try including Commctrl.h in stdarf.h and see what effect
it has?

Also note that the documentation says this is only applicable for
Windows XP, in which case you may be inadvertently compiling with the
symbol _WIN32_WINNT=0x0501 defined.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Similar Threads

1. Getting LNK2019 when using com exe while porting from VC6 to VC7

Hi All
         I'm porting my application from VC6 to VC7. There is a COM
exe that has successfully registered itself with system. But when I'm
using its services in other Dll I get this error.

SiIdSearch error LNK2019: unresolved external symbol "public:
__thiscall _com_ptr_t<class _com_IIID<struct
SIPROGRESSDIALOGMODLib::IProgressDialog,&struct __s_GUID const
_GUID_14ff1972_ead2_11d2_8f54_000000000000> >::_com_ptr_t<class
_com_IIID<struct SIPROGRESSDIALOGMODLib::IProgressDialog,&struct
__s_GUID const _GUID_14ff1972_ead2_11d2_8f54_000000000000> ><class
_com_IIID<struct SIPROGRESSDIALOGMODLib::IProgressDialog,&struct
__s_GUID const _GUID_14ff1972_ead2_11d2_8f54_000000000000> >(class
_com_ptr_t<class _com_IIID<struct
SIPROGRESSDIALOGMODLib::IProgressDialog,&struct __s_GUID const
_GUID_14ff1972_ead2_11d2_8f54_000000000000> > const &)"
(??$?0V?$_com_IIID@UIProgressDialog@SIPROGRESSDIALOGMODLib@@$1?_GUID_14ff1972_ead2_11d2_8f54_000000000000@@3U__s_GUID@@B@@@?$_com_ptr_t@V?$_com_IIID@UIProgressDialog@SIPROGRESSDIALOGMODLib@@$1?_GUID_14ff1972_ead2_11d2_8f54_000000000000@@3U__s_GUID@@B@@@@QAE@ABV0@@Z)
referenced in function "public: void __thiscall
CSiIdSearch::SubmitBatchSearch(class CSiStringList const &,int,class
ATL::CStringT<char,class StrTraitMFC_DLL<char,class
ATL::ChTraitsCRT<char> > >,class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > >,class
ATL::CStringT<char,class StrTraitMFC_DLL<char,class
ATL::ChTraitsCRT<char> > >,bool)"
(?SubmitBatchSearch@CSiIdSearch@@QAEXABVCSiStringList@@HV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@11_N@Z)


Do U have any idea what may be the reason.
Thanks in advance.
Sushma

2. Porting GCC code to VC7.1

3. VC6 to VC7 porting issues

Well I finally managed to get my hands on VC 7.1 (2003) and now
I am attempting to get our old projects to compile with it.

We have this SmartPtr class that was written a while back so we
have a lot of code that looks something like this:

TSmartPtr<MyClass> pMyObj;
...
ASSERT(NULL != pMyObj);

The TSmartPtr class has four friend operators defined:

friend bool operator==(TYPE* ptr, const TSmartPtr<TYPE>& kObject);
friend bool operator!=(TYPE* ptr, const TSmartPtr<TYPE>& kObject);
friend bool operator==(void* ptr, const TSmartPtr& kObject);
friend bool operator!=(void* ptr, const TSmartPtr& kObject);

Under VC6 the above ASSERT() would not compile without the void*
versions of the operators.  Under VC7 I get an ambiguous operator
error.  If I remove the void* versions, VC7 will compile, but
won't link.  It gives me an "unresolved external" error for
every instance where there was something like what is in the
ASSERT() above.

Is there any way I can get this to work in both VC6 and VC7?

Thanks
Murrgon

4. Porting Problem between VC6 and VC7

5. Linker error while porting to VC7

I ported my project to VC7 and got interesting results. While it
builds perfectly for /MD mode, at the same time it consistently gives
linker errors for /MT mode with all the equal conditions and settings.
Tried to specify default libraries explicitly: libcmt.lib and
libcpmt.lib - nothing helps. If anyone had this problem - please,
reply.

tlbase_new error LNK2001: unresolved external symbol "private: static
short const * const std::ctype<char>::_Cltab"
(?_Cltab@?$ctype@D@std@@0PBFB)

tlbase_new error LNK2019: unresolved external symbol "public: bool
__thiscall std::locale::_Iscloc(void)const "
(?_Iscloc@locale@std@@QBE_NXZ) referenced in function "class
std::ctype<char> const & __cdecl std::use_facet(class std::locale
const &,class std::ctype<char> const *,bool)"
(?use_facet@std@@YAABV?$ctype@D@1@ABVlocale@1@PBV21@_N@Z)

tlbase_new error LNK2019: unresolved external symbol "public: class
std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned
int,bool)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I_N@Z)
referenced in function "class std::ctype<char> const & __cdecl
std::use_facet(class std::locale const &,class std::ctype<char> const
*,bool)" (?use_facet@std@@YAABV?$ctype@D@1@ABVlocale@1@PBV21@_N@Z)

Thank you,
Dmitry

6. Porting VC6 to VC7.1, get error LNK2019

7. Upgrading VC6.0 and VC7.0 to VC7.1

I'm having immense problems and wondered if anyone could help. I
understand that VC7.1 has removed the ability to do some improper
things like including iostream headers. We have a couple of projects
that are huge and may have legacy C-Style code still lurking around.
There is also a lot of recently bought-in code which has been written
in C and been put into MFC projects. A couple of the main problems are
a heap of these style messages upon upgrading are.

c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\math.h(583) : error C2732: linkage specification
contradicts earlier specification for 'tanh'
        c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\math.h(582) : see declaration of 'tanh'

I tried converting all math.h to cmath but to no avail. Is this a
result of conflicting iostream and c++ headers, and if so is there an
easy way around it. I also have errors about missing .lib files on
another project which is presumably the same thing. So can you get a
tool to convert C code to conforming VC7.1 or are we going to have to
go back to VC7.0 because honestly it would take weeks to put right
manually.

Chris

8. ATLBrowser Example compiles on VC6, VC7, not VC7.1