The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: kyo on August 01, 2007, 10:54:13 AM

Title: ERR found in objASM32 example demo03
Post by: kyo on August 01, 2007, 10:54:13 AM
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
Title: Re: ERR found in objASM32 example demo03
Post by: Biterider on August 01, 2007, 11:59:43 AM
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]