Re: bool or BOOL in MFC projects
- From: Stuart Redmann <DerTopper@xxxxxx>
- Date: Tue, 18 Dec 2007 10:47:18 +0100
Vaclav wrote:
Hello,
Should I use bool or BOOL as a return type when I am implementing a new method?
I would make this dependent on whether only you use the return type, or if this return type will be used as parameter of an MFC function. In the first case I'd use bool because this type is the 'natural' Boolean type of C++. In the latter case, using the MFC type BOOL is probably better.
It's a pitty that MFC didn't change the Win32 type BOOL to the C++ type bool (after all, MFC is a C++ API). The overhead of the conversion between BOOL and bool can be neglected by any application that deals with a graphical user interface provided by GDI.
Regards,
Stuart
.
- Follow-Ups:
- Re: bool or BOOL in MFC projects
- From: David Ching
- Re: bool or BOOL in MFC projects
- References:
- bool or BOOL in MFC projects
- From: Vaclav
- bool or BOOL in MFC projects
- Prev by Date: Re: bool or BOOL in MFC projects
- Next by Date: How to disable the close button of a view in MDI
- Previous by thread: Re: bool or BOOL in MFC projects
- Next by thread: Re: bool or BOOL in MFC projects
- Index(es):
Loading