[求助]_CrtIsValidHeapPointer(pUserData)
各位高人,小弟初学VC,还望指教 想要用PowerSpectrum(int NumSamples, double *In, double *Out)函数使输出的Out里的数在坐标系上显示 编译时通过了 运行时出现_CrtIsValidHeapPointer(pUserData)错误 改怎么改呢?
int xb,y;
CWnd *PWnd=GetDlgItem(IDC_STATIC2);
CDC *PControlDC=PWnd->GetDC();
PWnd->Invalidate();
PWnd->UpdateWindow();
double *ru=new double[256];
double *chu=new double[256];
for(xb=0; xb<=255; xb+=1)
{
y=50+m_ctlSpinNum*sin(m_ctlSliDia*xb/180.*PI);
ru[xb]=y;
} PowerSpectrum(256, ru,chu);
for(xb=0; xb<=255; xb+=1)
{ y=chu[xb];
PControlDC->LineTo(xb,(int)y);
}
delete [] &ru;
delete [] &chu;
PWnd->ReleaseDC(PControlDC);