Simple. Your DIALOG DOEVENTS loop has no way of detecting that it needs to drop out, so runs endlessly.
For this simple (single modeless dialog) example, check the return value from DIALOG DOEVENTS (ie, DIALOG DOEVENTS TO nCount&) - see the help file for more information on DIALOG DOEVENTS.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Announcement
Collapse
No announcement yet.
Brain Fade...
Collapse
X
-
Brain Fade...
It must be the heat..
Can someone please tell me why when the following simple code
ends the EXE is still left in memory ??
#COMPILE EXE
#REGISTER NONE
#INCLUDE "win32api.inc"
FUNCTION PBMAIN() AS LONG
LOCAL hDlg AS LONG
LOCAL Result AS LONG
DIALOG NEW 0,"Test Window",,,400,300,%WS_SysMenu,0 TO hDlg
DIALOG SHOW MODELESS hDlg, TO Result
DO
DIALOG DOEVENTS
LOOP
END FUNCTIONTags: None
Leave a comment: