Main Content

Initialize[WithHandlers]

InitializeMATLABRuntimeinstance associated withlibrary

Synopsis

boollibraryInitialize(void) boollibraryInitializeWithHandlers( mclOutputHandlerFcn error_handler, mclOutputHandlerFcn print_handler)

Description

Each generated library has its ownMATLAB®Runtimeinstance. These two functions,libraryInitializeandlibraryInitializeWithHandlers, initialize theMATLAB Runtimeinstance associated withlibrary. Users must call one of these functions after callingmclInitializeApplication和之前调用的任何编译函数exported by the library. Each returns a boolean indicating whether or notmcliinitialization was successful. If they returnfalse, calling any further compiled functions results in unpredictable behavior.libraryInitializeWithHandlersallows users to specify how to handle error messages and printed text. The functions passed tolibraryInitializeWithHandlersare installed in theMATLAB Runtimeinstance and called whenever error text or regular text outputs.

Examples

if (!libmatrixInitialize()) { fprintf(stderr, "An error occurred while initializing: \n %s ", mclGetLastErrorMessage()); return -2; }

Version History

Introduced in R2009a