What is the difference between the NewMLApp.MLApp and CreateObject methods of creating a MATLAB ActiveX server from Visual Basic?

1 view (last 30 days)
There are two ways mentioned in the MATLAB Documentation to start a MATLAB ActiveX Automation Server:
Set Matlab=NewMLApp.MLApp
and
Set Matlab=CreateObject(“matlab.application” ).
I would like to know what the difference is between them.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The difference is that you need to add a reference in the first method, but not the second. Also, using the first method means you can use Visual Basic IntelliSense® ,
For example in the first case::
Set Matlab=NewMLApp.MLApp
You must add a reference to the MATLAB type library in your Visual Basic project. You can do this by clicking Project->References on the main menu.
If you use:
Set Matlab=CreateObject(“matlab.application” ).
You do not need to add a reference.

More Answers (0)

Tags

No tags entered yet.

Products

Community Treasure Hunt

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

Start Hunting!