void CMirror_Dot::ResetDot()
{
try
{
next_rank=NULL;         //指向下一层的镜像点
next_Dot=NULL;          //指向同一层下一个镜像点
throw "a";
}
catch(char *)
{
AfxMessageBox( "catchednextdot" ) ;  }
// last_layer=true;        //将最后一层标记初始化为true
try
{
traverse_flag=false;    //将遍历标记为false
point_on_flag=false;    //将点在面上的标记设为false
is_diffraction_dot=false; //将绕射点判断标记为false
throw "a";
}
catch(char *)
{
AfxMessageBox( "catchedflag" ) ;  }
}
一直异常啊
is_diffraction_dot是私有成员
别的都是mirror_dot的public成员

解决方案 »

  1.   

    [code=c]private: bool last_layer;                                public:
    CMirror_Dot();
    virtual ~CMirror_Dot(); CMirror_Dot *next_Dot; 
    CMirror_Dot *next_rank; CMirror_Dot *parent;   
    bool traverse_flag; 
    bool point_on_flag; 
      

  2.   

    try
    {
    p = NULL;
    //  throw "a";
    }
    catch(char *)
    {
    printf( "catchednextdot" ) ;  }
      

  3.   

     throw "a"; 注释掉!
      

  4.   

    经过多次试验,发现问题
    void CMirror_Tree::destroy_mirror_tree(CMirror_Dot *treePtr)
    {
    try
    {
    if(treePtr!=NULL)
    {
    destroy_mirror_tree(treePtr->next_Dot);
    destroy_mirror_tree(treePtr->next_rank);
    if(treePtr!=&source) //源点不能被删除
        
    delete treePtr;
            
         //throw "a";

    }
    }
    catch(char *)
    {
    AfxMessageBox( "catched" ) ;  }}
    第一次复位的时候程序没有提示错误,经过如上程序之后CMirror_Dot *treePt指向&source
    再次复位提示堆栈已经被破坏
      

  5.   

    delete treePtr;
    treePtr=0;// 如果 treePtr 还用 就 必须=0.
      

  6.   

    楼主仔细看下,throw是你的必经之路哦。
      

  7.   

    个人感觉你对指针是不是不很理解看c和指针
    http://download.csdn.net/detail/lghndyz/3314775