Mechanism for creating identical wrapper code across all platforms
typedef int (*mclMainFcnType)(int, const char **); int mclRunMain(mclMainFcnType run_main, int argc, const char **argv)
As you need to provide wrapper code when creating an application which uses a C or C++ shared
library created by MATLAB®
mclRunMain enables you with a mechanism for
creating identical wrapper code across all MATLAB
Compiler SDK platform environments.
mclRunMain is especially helpful in Macintosh OS X environments where a run loop must be created for correct MATLAB Runtime operation.
When a Mac OS X run loop is started, if
creating a run loop is a straightforward process. Otherwise, you must create a Cocoa
framework. The Cocoa frameworks consist of libraries, APIs, and MATLAB Runtime that form the development layer for all of Mac OS X.
Generally, the function pointed to by
run_main returns with a pointer
(return value) to the code that invoked it. However, when using Cocoa on the
Macintosh, when the function pointed to by
MATLAB Runtime calls exit before the return value can be received by the application
because the underlying code cannot get control when Cocoa is shut down.
You should not use
your application brings up its own full graphical environment.
In non-Macintosh environments,
mclRunMain acts as a wrapper
and does not perform any significant processing.
Name of function to execute after MATLAB Runtime set-up code.
Number of arguments being passed to
Pointer to an array of character pointers. Usually,
Call using this basic structure:
int returncode = 0; mclInitializeApplication(NULL,0); returncode = mclRunMain((mclmainFcn) my_main_function,0,NULL);
Introduced in R2010b