我在运行时出现Unhandled exception at 0x78531986 in liyx_1.exe: 0xC0000005: Access violation reading location 0x00000024.的问题,求大侠们帮帮忙~~~
代码:void Cliyx_1Dlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
mxArray *m= NULL;
int i;
double *Dreal;
CString m_str1;
Engine *ep;
if(!(ep=engOpen(NULL)))
if(!(ep=engOpen("NULL")))
{
fprintf(stderr,"\n MATLAB 引擎启动失败!\n");
MessageBox(_T(" MATLAB 引擎启动失败!"),_T("MATLAB 引擎"),MB_OK|MB_ICONERROR);
exit(-1);
}
m=engGetVariable(ep,"y2");
Dreal = mxGetPr(m);
for(i=0;i<126;i++)
{
m_str1.Format(_T("%f"),Dreal[i]);
m_str+=m_str1;
    UpdateData(false);
}
}