程序中有一段:
BYTE *pThreshold2;
CString strTemp;
strTemp.Format("%d\n%d",Height,widthDW8);
AfxMessageBox(strTemp);
Threshold2=new BYTE[Height*widthDW8];
AfxMessageBox("2");
delete []pThreshold2;Debug下一点问题都莫的,release运行的,第一个对话框能弹出,看到Height,widthDW8值为2333,1786,,,然后第二个对话框没弹出,程序报runtime error,,,请大家帮帮忙,谢了.

解决方案 »

  1.   

    我试了,测试代码如下:
    void CDlgTest01Dlg::OnButton1() 
    {
    // TODO: Add your control notification handler code here
    int Height, widthDW8;
    Height = 2333;
    widthDW8 = 1786;
    BYTE *pThreshold2;
    CString strTemp;
    strTemp.Format("%d\n%d",Height,widthDW8);
    AfxMessageBox(strTemp);
    pThreshold2=new BYTE[Height*widthDW8];
    AfxMessageBox("2");
    delete []pThreshold2;
    }debug和release下都没有问题。
      

  2.   

    多谢关注,,补充一下,代码在一个图像处理函数中,里面进行了很多new,delete 的操作,,,然后该函数又被一个线程调用.用VC6写的.
      

  3.   

    找到问题了,,前面定义了个_int64 MyData[8];后面居然用到了MyData[8],MyData[9],,VC6阿,想说爱你不容易