我要用VS实现的图形算法有些复杂,想去调用matlab转成的动态库~可是在调用的时候出错了:
double A = 2;
double B = 3;
double SUM = 0;
if(!mclInitializeApplication(NULL, 0))
AfxMessageBox(_T("shit!!!"));
if( !myAddFunInitialize())
{
AfxMessageBox(_T("Could not initialize !"));
return ;
}
mwArray wmA(1, 1, mxDOUBLE_CLASS, mxREAL);
mwArray wmB(1, 1, mxDOUBLE_CLASS, mxREAL);
mwArray wmSUM(1, 1, mxDOUBLE_CLASS, mxREAL);
wmA.SetData(&A, 1);
wmB.SetData(&B, 1);
add(1, wmSUM, wmA, wmB);
SUM = wmSUM.Get(1, 1);
if(SUM == 5)
AfxMessageBox(_T("OK!"));
myAddFunTerminate();
mclTerminateApplication();
异常中断在mwArray wmA(1, 1, mxDOUBLE_CLASS, mxREAL); 这句调用之后
错误信息详细是:
First-chance exception at 0x74DF812F in StructureExtraction.exe: Microsoft C++ exception: apiException at memory location 0x002AF0FC.
First-chance exception at 0x74DF812F in StructureExtraction.exe: Microsoft C++ exception: apiException at memory location 0x002AF0F8.
0x00000000 处的第一机会异常(在 StructureExtraction.exe 中): 0xC0000005: 执行位置 0x00000000 时发生访问冲突。
0x00000000 处有未经处理的异常(在 StructureExtraction.exe 中): 0xC0000005: 执行位置 0x00000000 时发生访问冲突。
0x00000000 处的第一机会异常(在 StructureExtraction.exe 中): 0xC0000005: 执行位置 0x00000000 时发生访问冲突。
0x00000000 处有未经处理的异常(在 StructureExtraction.exe 中): 0xC0000005: 执行位置 0x00000000 时发生访问冲突。