CException::Delete

王朝百科·作者佚名  2012-04-17  
宽屏版  字体:   |    |    |  超大  

CException::Delete

void CException::Delete();

说明:

此函数检查CException对象是否在堆顶建立,如果在堆顶建立,对该对象做删除操作。当删除该CException对象后,使用Delete成员函数删除异常。不要直接使用删除操作,因为CException对象可能是一个全局对象或者是在栈中创建的。

你可以指定当对象被创建时是否应被删除。要了解更多信息,请参阅CException::CException。

如果使用C++“试抓”(try-catch)机制,只需调用Delete。如果使用MFC的TRY和CATCH宏,这些宏会自动调用此成员函数。

MSDN 解释如下:

CException::Delete

void CException::Delete( );

Remarks

This function checks to see if the CException object was created on the heap, and if so, it calls the delete operator on the object. When deleting a CException object, use the Delete member function to delete the exception. Do not use the delete operator directly, because the CException object may be a global object or have been created on the stack.

You can specify whether the object should be deleted when the object is constructed. For more information, see CException::CException.

You only need to call Delete if you are using the C++ try-catch mechanism. If you are using the MFC macros TRY and CATCH, then these macros will automatically call this function.

 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝百科 版权所有