Tuesday, March 11, 2008

#DEFINE VS ENUM revisited

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.

No comments: