Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB Compiler   

mclWaitForFiguresToDie - Enables deployed applications to process Handle Graphics events, enabling figure windows to remain displayed.

Syntax

void mclWaitForFiguresToDie(HMCRINSTANCE inst)

Description

Calling void mclWaitForFiguresToDie(HMCRINSTANCE inst) enables the deployed application to process Handle Graphics events. If this function is not called, any figure windows initially displayed by the application will briefly appear and then the application will exit.

This function returns only when the last figure window is manually closed — therefore, this function should be called after the library launches at least one figure window.

This function may be called multiple times. If the input argument, an MCR instance, is null, the function monitors the figures of the current MCR.

This function can only be called after <library>Initialize has been called and before <library>Terminate has been called.

Example

int run_main(int argc, const char** argv)
{
    int some_variable = 0; 
    
    if (argc > 1)
        test_to_run = atoi(argv[1]);
    /* Initialize application */
    if( !mclInitializeApplication(NULL,0) )
    {
        fprintf(stderr, "Could not initialize the 
                              application.\n");
        return(-1);
    }
    if (test_to_run == 1 || test_to_run == 0)
    {
        /* Initialize ax1ks library */
        if (!libax1ksInitialize())
        {
            fprintf(stderr,"Could not initialize 
                            the ax1ks library.\n");
            return (-2);
        }
    }
    if (test_to_run == 2 || test_to_run == 0)
    {
        /* Initialize simple library */
        if (!libsimpleInitialize())
        {
            fprintf(stderr,"Could not initialize 
                            the simple library.\n");
            return (-3);
        }
    }
    /*           your code here
    /*           your code here                  
    /*           your code here
    /*           your code here
    /*
    /* Block on open figures */
    mclWaitForFiguresToDie(NULL);
    /* Terminate libraries */
    if (test_to_run == 1 || test_to_run == 0)
        libax1ksTerminate();
    if (test_to_run == 2 || test_to_run == 0)
        libsimpleTerminate();
    /* Terminate application */
    mclTerminateApplication();
    return(0);
}

See Also

mclKillAllFigures

Blocking Execution of a Console Application with the mclWaitForFiguresToDie Method

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS