flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
shoorick 01 Sep 2006, 11:14
correct way to close dialog box is using of EndDialog, and ExitProcess has to be placed after DialogBoxParam. otherwise everything depends on capabilities of OS to clear all resources by process. some controls may allocate memory or other resources, and should be closed correctly to release all of them - this will be done by default dialog procedure. You may feel visually ok just because your program is extremelly lite, but this way is incorrect.
|
|||
![]() |
|
shoorick 01 Sep 2006, 11:16
btw, is it working example with commented GetModuleHandle?
![]() |
|||
![]() |
|
Slai 01 Sep 2006, 17:21
Yes it works without it. There was a thread in here that was discussing the use of GetModuleHandle, and I didn't saw an satisfying aswer why it should be used, but I guess it should be used for compability isues ..
I know about the correct way to close a dialog, I was just curious how incorect is this one. So exiting this way may leave resources in the memory and make this memory unusable by the other programs ? |
|||
![]() |
|
shoorick 04 Sep 2006, 05:13
So exiting this way may leave resources in the memory and make this memory unusable by the other programs > yes
|
|||
![]() |
|
f0dder 04 Sep 2006, 11:12
shoorick wrote: So exiting this way may leave resources in the memory and make this memory unusable by the other programs > yes Nope. Windows does cleanup when your process terminates. The only thing you have to be vary of is GDI stuff if you want to support win9x - win9x is a leaky piece of shit that doesn't handle stuff well. _________________ carpe noctem |
|||
![]() |
|
Slai 05 Sep 2006, 01:45
I goth both, expected and satisfying answers
![]() |
|||
![]() |
|
shoorick 05 Sep 2006, 04:54
Windows does cleanup when your process terminates
i will not insist on opposite, but there are could be controls on dialog which may create some global/shareable/COM etc. objects which can be left after process has been terminated. editbox, btw, allocates memory in global memory (to be compatible with win3x i think, unless it has DS_LOCALEDIT style). |
|||
![]() |
|
f0dder 05 Sep 2006, 06:01
"There is no such thing as global memory on win32", especially not NT. Closest you come would be named memory mapped files, but those should be cleaned up even on TerminateProcess. And ExitProcess is even cleaner than that.
Or perhaps you know something I don't ![]() |
|||
![]() |
|
shoorick 05 Sep 2006, 06:54
Or perhaps you know something I don't > i do not think so
![]() just prefer to be sure then hope. btw, it is possible exit window proc with "retn" instead "retn 16" (whole byte economy ![]() ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.