I will just ask. Maby somebody had the same problem as I.

So I made Tab Control inside my dialog. My Tab Control Contains few child window (one visible at the time). All My Tab Indexes point to the same WndProc

here is one of them:
(invoke CreateDialogParam,hInstance,IDD_DLGCHILD,hTabNew,ADDR DlgNewTabProc,0)

ending part of DlgNewTabProc:

.elseif eax==WM_DESTROY
mov ebx,hWin
PrintHex ebx
invoke EndDialog,hWin,0
PrintDec eax
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
DlgNewTabProc endp

This Proc is destroying this few child Dialogs and EndDialog is returning 1

So everything should be just fine but MemProf shows unfreed Res (It's just one example but all my child dialogs inside Tab Control are unfreed)

# Item Kind Value Size Thread API Name Module

3 CreateDialogParam(4194304,400,1442820,00401BBB,0) Dialog 00190408 0 2340 CreateDialogParamA user32.dll
Posted on 2003-11-12 18:35:13 by AceEmbler
Maybe try sending EndDialog in the WM_CLOSE handler, I have found that though very good, MemProof can sometimes be a bit flaky with the order that resources are freed.
Posted on 2003-11-12 19:09:12 by donkey
Hi, guys :)

AFAIK, EndDialog should only be called for modal dialog boxes. Modeless ones should be closed by sending WM_DESTROY. So I guess you could send WM_DESTROY in a loop when processing that message in your main window.

Anyway I think that child modeless dialogs are destroyed automatically by the system after processing WM_DESTROY in the main window, and MemProof is complaining for no good reason (I found this program not to track resources correctly, very often you get false alarms -still a good way to track unexpected leaks).
Posted on 2003-11-12 19:32:56 by QvasiModo
or you may try PostQuitMessage in WM_CLOSE handler. Wow now i saw QvasiModo had post. I am agree with him.
Posted on 2003-11-12 19:41:35 by cakmak
WM_CLOSE is not working it looks like my child is not sending this message.


Anyway I think that child modeless dialogs are destroyed automatically by the system after processing WM_DESTROY in the main window, and MemProof is complaining for no good reason (I found this program not to track resources correctly, very often you get false alarms -still a good way to track unexpected leaks).



a lot of resource are destroyed during WM_DESTROY as i think but memProf shows us what havent we destroyed by ourselfes.
Posted on 2003-11-13 06:02:49 by AceEmbler
I had a problem with memproof reporting errors for something like this. Try to call the def window proc at the end of your WM_DESTROY handler. I once got errors from windows I had explicitly destroyed in the WM_CLOSE message but they disappeared when I called DefWindowProc at the end.

.ELSEIF uMsg == WM_DESTROY

.
.
.
.
invoke PostQuitMessage,0
; Make sure that everything else is cleaned up by calling the DefDlgProc
jmp @F

.ELSE
@@:invoke DefDlgProc,hWin,uMsg,wParam,lParam
ret
Posted on 2003-11-13 06:24:00 by donkey