Can the MATLAB Data API be used with MFC framework

The following code snippet runs OK within a console application but will crash on the call to initMATLABApplication if put within a MFC application. It also seems that the runMain function would/can only be called within main(), which MFC does not provide?
auto mode = mc::MATLABApplicationMode::IN_PROCESS;
const std::string STR_OPTIONS = "-nojvm";
const std::u16string U16STR_OPTIONS = convertAsciiToUtf16(STR_OPTIONS);
std::vector<std::u16string> options = { U16STR_OPTIONS };
m_matlabApplication = mc::initMATLABApplication(mode, options);
int ret = mc::runMain(&CADCTestDlg::RunADCMetrics, std::move(matlabApplication), 0, NULL);

Respuestas (0)

Categorías

Más información sobre MATLAB Compiler SDK en Centro de ayuda y File Exchange.

Productos

Versión

R2021b

Etiquetas

Preguntada:

el 8 de Dic. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by