| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB Compiler |
| Contents | Index |
| Learn more about MATLAB Compiler |
void mclWaitForFiguresToDie(HMCRINSTANCE inst)
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.
Note WaitForFiguresToDie will block the calling program only for MATLAB figures. It will not block any Java GUIs, ActiveX controls, and other non-MATLAB GUIs unless they are embedded in a MATLAB figure window. |
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);
}
Blocking Execution of a Console Application That Creates Figures and Terminating Figures by Force

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |