Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
To conserve system resources and maintain overall system stability, it is important for any application to exit gracefully. To ensure that your Silverlight for Windows Embedded application exits gracefully, you use the EndDialog method of the visual host object, IXRVisualHostPtr.
In this article:
Graceful Exit
A graceful exit is one in which the application’s automatic cleanup routines are executed prior to the application being unloaded from memory. Use the EndDialog method of the visual host to exit a Silverlight for Windows Embedded application gracefully.
How to exit the application gracefully
Add the following code to your application source:
void ExitApplication() { IXRVisualHostPtr pHost = NULL; HRESULT hr = App::GetVisualHost(&pHost); if ( pHost ) { pHost->EndDialog(0); } }
Call the ExitAppliction() method to exit the application gracefully.