ASSERT_VALID(pDoc);是什么意思?

cowboy2006 2004-04-28 11:05:12
ASSERT_VALID(pDoc);是什么意思?其中pDoc为文档类指针。请指教,谢谢。
...全文
3277 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Yao-debo 2004-05-12
  • 打赏
  • 举报
回复

不是的, 在release 中也可以,只是没有调试的信息。
不知写的对不对?
findcsdn 2004-04-28
  • 打赏
  • 举报
回复
是一个断定宏,就是肯定pDoc不为空,如果pDoc为NULL就不继续运行的意思。
zhonglingqqxh 2004-04-28
  • 打赏
  • 举报
回复
是不是只在调试版本中有用啊
PiggyXP 2004-04-28
  • 打赏
  • 举报
回复
就是要确定pDoc可用,如果不可用则出现assert错误,中断程序运行
spwnihao 2004-04-28
  • 打赏
  • 举报
回复
MSDN

Use to test your assumptions about the validity of an object’s internal state.
ASSERT_VALID calls the AssertValid member function of the object passed as its argument.

In the Release version of MFC, ASSERT_VALID does nothing. In the Debug version, it validates the pointer, checks against NULL, and calls the object’s own AssertValid member functions. If any of these tests fails, this displays an alert message in the same manner as ASSERT.

Note This function is available only in the Debug version of MFC.

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧