VC6.0里面的程序有很多地方用到了BOOL 例如BOOL Create , BOOL CMyView::OnDraw 等,有没有高手能具体说明一下用法和意思,感激不尽。

解决方案 »

  1.   

    Create //窗口的初始化
    OnDraw //视图的绘制
      

  2.   

    没有其他的说明了嘛?比如说小写的bool仅仅是返回true和FALSE,一些书里说大写的BOOL是返回1,0,-1,有没有更深层的解释,既然是创建BOOL应该是返回TRUE和FALSE才对呀
      

  3.   

     Boolean variable (should be TRUE or FALSE). This type is declared in WinDef.h as follows:
    typedef int BOOL;
     msdn里如是说
      

  4.   

    HRESULT OnDraw(
      HDC  hdcDraw,
      LPCRECT  prcDraw
    );
    CWnd::Create返回的就是bool值,virtual BOOL Create(
       LPCTSTR lpszClassName,
       LPCTSTR lpszWindowName,
       DWORD dwStyle,
       Const RECT& rect,
       CWnd* pParentWnd,
       UINT nID,
       CCreateContext* pContext = NULL
    );
     Return Value
    Nonzero if successful; otherwise 0.
    没有你说的返回-1
      

  5.   

    BOOL实质就是int,FALSE和TRUE都是宏,bool是基本类型,仅此而已。