my vc code test function:
void CzjTestDemo1Dlg::OnBnClickedButton2()
{
// TODO: Add your control notification handler code here
Engine* pEng = NULL;
if (!(pEng = engOpen(NULL)))
{
printf("Open matlab enging fail!");
return;
}
if( !mclInitializeApplication(NULL,0) )
{
AfxMessageBox( "Could not initialize the application.");
exit(1);
}
if (!ret_int_LibInitialize())
{
AfxMessageBox("Could not initialize the library.");
exit(1);
}
double xxxx[1] = {0};
double inin = 0;
double yyyy[1] = {0};
double outo = 0;
//
mwArray mwXX(1, 1, mxDOUBLE_CLASS);
mwArray mwIn(1, 1, mxDOUBLE_CLASS);
mwArray mwYY(1, 1, mxDOUBLE_CLASS);
mwArray mwOut(1, 1, mxDOUBLE_CLASS);
//
mwXX.SetData((mxDouble *)&xxxx, 1);
mwIn.SetData(&inin, 1);
//
//mlxLi_ret_int(2,&mwYY, mwOut,mwXX,mwIn);
li_ret_int(1,mwOut,mwIn);
//
outo = mwOut.Get(1, 1);
// lib Terminate
ret_int_LibTerminate();
// MCR Terminate
mclTerminateApplication();
}