My Matlab code (GUI) is launched using Matlab engine, via C++. When pressing on one button, an new C++ interface is launched. So I have: C++ -> MATLAB -> C++

Here are my 3 issues:

1) When deployed, my Matlab code will not be able to "discuss" with the C++ code as it currently does. How can I create C++ events from a deployed Matlab code? It is deployed in an executable file. Should I deploy it into C++ shared library? Would it then be possible to create events?

2) As stated, pressing on button returns an event to C++ code. In one case, the event consists into opening a C++ GUI. The only way to call C++ from Matlab is using MEX file?

3) I want to create a MEX file from C++ with UiMX. Is MEX compiler compatible with UiMX?

I guess if there is an answer to the first issue, the second could be solved.