First step: Create M function
The second step: in the MATLAB environment, the WANGYUANPRJ3.M compiler generated dynamic link
Start--matlab--matlab Compiler--deploymentproject
Get:
The third step: In the VC create a Dialog based MFC application Engineering, named Mccmfc03, dialog box set as follows:
settings are as follows:
Fourth Step: Copy the Wangyuanprj3.h, Wangyuanprj3.lib, wangyuanprj3.dll files generated in the second step to the directory where the MCCMFC03 project files are located.
Fifth Step: Fill in the code
1) Include Mcctest02.h file in Mccmfc03dlg.cpp
2) in the Cmccmfc02::oninitdialog function, the initialization of MCR and library functions is implemented:
3) Add mouse click event Response function for Test button onbuttontest ()
4) Add mouse click event Response function for the Close button onbuttonclose ()
Sixth Step: Modify the Project Settings
Project--Setup--Connect--object/library module, add two required connection library functions Wangyuanprj3.lib and Mclmcrrt.lib
Seventh Step: Compile VC Project MCCMFC03, run can. (Enter A:5,b:4, click Test)