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);

Answers (0)

Categories

Find more on MATLAB Compiler SDK in Help Center and File Exchange

Products

Release

R2021b

Asked:

on 8 Dec 2021

Community Treasure Hunt

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

Start Hunting!