Skip to Main Content Skip to Search
Product Documentation

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

Synopsis

void mclWaitForFiguresToDie(HMCRINSTANCE instReserved) 

Description

Calling void mclWaitForFiguresToDie enables the deployed application to process Handle Graphics events.

NULL is the only parameter accepted for the MCR instance (HMCRINSTANCE instReserved).

This function can only be called after libraryInitialize has been called and before libraryTerminate has been called.

mclWaitForFiguresToDie blocks all open figures. This function runs until no visible figures remain. At that point, it displays a warning if there are invisible figures present. 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 this function is not called, any figure windows initially displayed by the application briefly appear, and then the application exits.

Examples

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,
						"An error occurred while
								initializing: \n %s ",
						mclGetLastErrorMessage());
			return -1;
		}

		if (test_to_run == 1 || test_to_run == 0)
		{
			/* Initialize ax1ks library */
			if (!libax1ksInitialize())
			{
					fprintf(stderr,
							"An error occurred while
								initializing: \n %s ",
							mclGetLastErrorMessage());
					return -1;
			}
		}

		if (test_to_run == 2 || test_to_run == 0)
		{
			/* Initialize simple library */
			if (!libsimpleInitialize())
			{
					fprintf(stderr,
							"An error occurred while
								initializing: \n %s ",
							mclGetLastErrorMessage());
					return -1;
			}
		}

		/* 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);
}

How To

  


Free MATLAB Compiler Interactive Kit

Learn how to build standalone executables and C/C++ shared libraries from MATLAB code.


Get free kit

Trials Available

Try the latest version of MATLAB Compiler.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS