A Journey 2 Eternity

#DEFINE VS ENUM revisited

Posted on: March 11, 2008

Tried to declare an enum inside a class like CEMCHotButton:

enum TextAlignment

{

TA_LEFT = 0

};

And there were 100 errors showing up without any traceable reason.

Finally I found that, a same DEFINE is declared in WINGDI.H header file and it’s made a conflict with my DEFINE value.

Now the problem is, define cannot be put under a namespace or any scope, therefore I have to change the enum type name.

This is forcing me to name TA_LEFT, to TF_LEFT.

Advertisements
Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Pages

Categories

March 2008
M T W T F S S
« Dec   Apr »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Blog Stats

  • 27,491 hits
%d bloggers like this: