About BOOL, BOOLEAN and bool on Windows

Well, this was what I wondered when I used MFC/Win32 a lot when I was a sophormore. Why are there so many boolean type on Windows? And why did people at MS made such many boolean type? Well, actually they are not new. They are just alias of int and char, or BYTE.

In C, there was no native BOOL type. C++ added boolean for this. During the days of C, people tened to define an alias for boolean type using typedef and mapped it to int or char.

However, for MFC and Win32, why are there BOOL and BOOLEAN? I found explanation for them long time ago. However, now I forgot it. So, I searched it again.
Here is a good explanation from MS’s blog.

BOOL vs. VARIANT_BOOL vs. BOOLEAN vs. bool

Well.. for C#, they made another one, bool. ( glad that it is same to C++ bool. )

Ah.. Microsoft….

Leave a Reply

Please log in using one of these methods to post your comment:

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

%d bloggers like this: