once the modless dialog is shown its never shown again
;invoke SetFocus, [eax].Dialog.hWnd ;doesnot sets focus because window is distroyed
i modified the code a little bit and now its working insead of ;OCall esi.DestroyDialog, wParam i just hide it any how if destroyed i dont know why [esi].pModelessDlg == NULL is true.?? :eek
Case IDM_HELLO
.if [esi].pModelessDlg == NULL
mov [esi].pModelessDlg, $New(ModelessDlg, Init, esi, [esi].hWnd, "DIALOG1")
OCall [esi].pModelessDlg::ModelessDlg.Show
.else
mov eax, [esi].pModelessDlg
invoke ShowWindow,[eax].Dialog.hWnd,SW_SHOW
;invoke SetFocus, [eax].Dialog.hWnd
.endif
.if ax == IDOK
OCall esi.CtlsGet
invoke ShowWindow,[esi].hWnd, SW_HIDE
;OCall esi.DestroyDialog, wParam
.elseif ax == IDCANCEL
invoke ShowWindow,[esi].hWnd, SW_HIDE
;OCall esi.DestroyDialog, wParam
Hi kyo
You are right, there is bug in the code. It was introduced when I changed the Destroy macro to don't reset the object pointer to NULL.
The corrected code is attached. Thanks for reporting this issue.
Regards,
Biterider
[attachment deleted by admin]