Article View: borland.public.cppbuilder.nativeapi
Article #5398Re: [C++ Error] uxtheme.h(176): E2146 Need an identifier to declare
From: Ed Mulroy
Date: Fri, 19 Aug 2005 18:35
Date: Fri, 19 Aug 2005 18:35
102 lines
4438 bytes
4438 bytes
You missed some changes.
Remember how MS always did structures, something like this:
typedef struct tag_RECT
{
int left;
int top;
int right;
int bottom;
} RECT;
Well, to do the change you do something like this:
========================
typedef enum tag_THEMESIZE
{
TS_MIN, // minimum size
TS_TRUE, // size without stretching
TS_DRAW, // size that theme mgr will use to draw part
} THEMESIZE;
:
THEMEAPI GetThemePartSize(HTHEME hTheme,
HDC hdc, int iPartId, int iStateId,
OPTIONAL RECT *prc, enum tag_THEMESIZE eSize, OUT SIZE *psz);
// note the use above of tag_THEMESIZE instead of THEMESIZE
========================
OR get rid of the use of the word 'enum' in front of a name which is a
typedef.
Similar situation with PROPERTYORIGIN
I actually go out of my way to keep the original in the file just in case I
need to be able to find it later. Here is the THEMESIZE alteration from the
header file on my machine (word wrapped a bit to defend agains what the news
reader will do to it. Note that WANT_ERROR_IN_UXTHEME_H_FILE is not
defined.
========================
#ifdef WANT_ERROR_IN_UXTHEME_H_FILE
typedef enum THEMESIZE
{
TS_MIN, // minimum size
TS_TRUE, // size without stretching
TS_DRAW, // size that theme mgr will use to draw part
};
#else
typedef enum tag_THEMESIZE
{
TS_MIN, // minimum size
TS_TRUE, // size without stretching
TS_DRAW, // size that theme mgr will use to draw part
} THEMESIZE;
#endif
//-------------------------------------------------------------------------
// GetThemePartSize() - returns the specified size of the theme part
//
// hTheme - theme data handle
// hdc - HDC to select font into & measure against
// iPartId - part number to retrieve size for
// iStateId - state number (of the part)
// prc - (optional) rect for part drawing destination
// eSize - the type of size to be retreived
// psz - receives the specified size of the part
//-------------------------------------------------------------------------
#ifdef WANT_ERROR_IN_UXTHEME_H_FILE
THEMEAPI GetThemePartSize(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId,
OPTIONAL RECT *prc,
enum THEMESIZE eSize, OUT SIZE *psz);
#else
THEMEAPI GetThemePartSize(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId,
OPTIONAL RECT *prc,
enum tag_THEMESIZE eSize, OUT SIZE *psz);
#endif
========================
. Ed
> JD wrote in message
> news:43061e9b$1@newsgroups.borland.com...
>
>> There appears to be a bug in the header. [...] I am
>> modifying mine right now.
>
> Try to include it. The changes generate several errors:
>
> [C++ Error] uxtheme.h(189): E2447 'THEMESIZE' must be a previously defined
> enumeration tag
> [C++ Error] uxtheme.h(189): E2238 Multiple declaration for 'THEMESIZE'
> [C++ Error] uxtheme.h(176): E2344 Earlier declaration of 'THEMESIZE'
> [C++ Error] uxtheme.h(561): E2447 'PROPERTYORIGIN' must be a previously
> defined enumeration tag
> [C++ Error] uxtheme.h(561): E2238 Multiple declaration for
> 'PROPERTYORIGIN'
> [C++ Error] uxtheme.h(546): E2344 Earlier declaration of 'PROPERTYORIGIN'
Technical Details
Message-ID:
<43062657$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<43061578@newsgroups.borland.com> <43061bdd$1@newsgroups.borland.com> <43061e9b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fb85fd278a19acb2 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Ed Mulroy" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <43061578@newsgroups.borland.com> <43061bdd$1@newsgroups.borland.com> <43061e9b$1@newsgroups.borland.com> Subject: Re: [C++ Error] uxtheme.h(176): E2146 Need an identifier to declare Date: Fri, 19 Aug 2005 14:35:14 -0400 Lines: 104 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 69.134.170.196 Message-ID: <43062657$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1124476503 69.134.170.196 (19 Aug 2005 11:35:03 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail