News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ERR found in objASM32 example demo03

Started by kyo, August 01, 2007, 10:54:13 AM

Previous topic - Next topic

kyo

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

Biterider

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]