不仅仅局限于以下的例子,帮忙请问VERIFY函数起什么作用,能具体讲解一下吗?谢谢!CBitmap bitmap;
VERIFY(bitmap.LoadBitmap(IDB_SHAPES));

解决方案 »

  1.   

    In the debug version of MFC, the VERIFY macro evaluates its argument. If the result is 0, the macro prints a diagnostic message and halts the program. If the condition is nonzero, it does nothing.
      

  2.   

    ASSERT(booleanexpression)booleanexpression 零或非零表达式
    如果为零,则宏打出诊断信息,并且异常中断程序,诊断信息的形式为在什么文件的第几行断定失败。用法同VERIFY(booleanexpression)不论怎样,他可以中止程序。具体这两个函数的区别我不太清楚,一般我们在比较重要的地方就需要加入这样的判定语句,保证程序的严密与安全性。