Hello,
in order to exit a Win32 application Microsoft has provided the API function PostQuitMessage( int aExitCode ). The implementation of your slot method should thus invoke this function. To do this you have to enclose the function invocation within a native block. The following could be the implementation:
$if !$prototyper native { /* Predeclaration of the Win32 API */ extern void __stdcall PostQuitMessage( int nExitCode ); /* Invocation of the API */ PostQuitMessage(0); } $endif
Please note the used $if .. $endif directives to ensure that the native code is not used when you test your application within Embedded Wizard.
Does it answer your question?
Best regards
Paul Banach
Hi,
place a variable into your file ewmain.c, e.g.
int ExitApplication = 0;
In the slot method of your button you can place a native code to set the 'C' variable:
extern int ExitApplication; ExitApplication = 1;
Within the main loop of the application you can evaluate the 'C' variable and use it as return value for EwProcess(). As a result, the main loop will run until your variable ExitApplication is 1. See also Life Cycle of the GUI Application.
Ask Embedded Wizard
Welcome to the question and answer site for Embedded Wizard users and UI developers.
Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!
Embedded Wizard Website | Privacy Policy | Imprint