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 - Archive
Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!
Your resources:
The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.
For dedicated assistance, explore our Embedded Wizard Product Support.
You can still browse the valuable discussions from our community history here.
Embedded Wizard Website | Privacy Policy | Imprint