如题

解决方案 »

  1.   

    AssertValid performs a validity check on this object by checking its internal state. In the Debug version of the library, AssertValid may assert and thus terminate the program with a message that lists the line number and filename where the assertion failed.
    用来在程序运行时检查对象的正确性。
    When you write your own class, you should override the Dump function to provide diagnostic services for yourself and other users of your class. The overridden Dump usually calls the Dump function of its base class before printing data members unique to the derived class. CObject::Dump prints the class name if your class uses the IMPLEMENT_DYNAMIC or IMPLEMENT_SERIAL macro.
    也是用来检查的,只不过要你自己实现。
      

  2.   

    比喻一个窗口你想确定是否创建成功如果失败就提示你。
    assert(wnd.create(xx));
      

  3.   

    just as their names imply , they provide diagnostic infomations
    for your objects .
    AssertValid is used to define your own rule to judge a object is
    valid or not , and Dump is used to provide your own debug 
    infomation , u'll see it when 'afxDump << object' is been called .
      

  4.   

    AssertValid函数是用来判断表达式的合法性或正确性,如果不正确或不合法则终止程序并返回相应的提示信息
    如AssertValid(t==0);//用来判断t是否等于0,如果t!=0则终止程序
    Dump函数一般用来显示debug信息的,其函数中的内容一般在debug时,在debug窗口中才能看到。
    具体如 peterguan(糖糖) (  ) 所给的
      

  5.   

    debug可用! AssertValid很有用处,从CObject派生的类都有这个函数,如果你要特定的类的成员变量的断言,可以重载这个函数,常常看到ASSERT_VALID这个宏实际调用了这个函数.
      Dump可以在调是状态下,输出类的的成员变量,方便调试.