Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

<library>Initialize[WithHandlers]

Initialize MATLAB Runtime instance associated with library

Synopsis

bool libraryInitialize(void) 
bool libraryInitializeWithHandlers( 
             mclOutputHandlerFcn error_handler, 
             mclOutputHandlerFcn print_handler) 

Description

Each generated library has its own MATLAB® Runtime instance. These two functions, libraryInitialize and libraryInitializeWithHandlers initialize the MATLAB Runtime instance associated with library. Users must call one of these functions after calling mclInitializeApplication and before calling any of the compiled functions exported by the library. Each returns a boolean indicating whether or not initialization was successful. If they return false, calling any further compiled functions will result in unpredictable behavior. libraryInitializeWithHandlers allows users to specify how to handle error messages and printed text. The functions passed to libraryInitializeWithHandlers will be installed in the MATLAB Runtime instance and called whenever error text or regular text is to be output.

Examples

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

Introduced in R2009a

Was this topic helpful?