The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: M@st3r on June 14, 2006, 01:32:41 AM

Title: DialogBoxParam bug on Windows XP
Post by: M@st3r on June 14, 2006, 01:32:41 AM
Hi all,
I have created a lot of program on Win 98 that use the DialogBoxParam API as Main Window and I compile this with MASM32 v9 and I tryed one of my programs on Windows XP (sp2) and it bug
What's the problem ????
Download the file plz and check it


[attachment deleted by admin]
Title: Re: DialogBoxParam bug on Windows XP
Post by: Mincho Georgiev on June 14, 2006, 03:06:14 AM
Hi and welcome!

1st - Your Dialog Procedure Should return 0 to Dialog to work properly.
2nd - You dont have the right to use this dialog in your App, unless you're the autor of WinRaR !!!
Title: Re: DialogBoxParam bug on Windows XP
Post by: no-one on June 14, 2006, 03:28:02 AM
Alos your program is written wrong.  You invoke the dialog box procedure and then you crash into it because you do not have a line that says

invoke     ExitProcess,0

After the dialog box invoke line

Paul
Title: Re: DialogBoxParam bug on Windows XP
Post by: M@st3r on June 16, 2006, 02:22:02 AM
Thank a lot shaka_zulu for your help and I just use the Ressource of the REMINDER DialogBox of WinRAR for test. I know that it's illegal to put ressource of copyrighted software, but I just put the ressource for a test. And second, it is not obligatory to put ExitProcess, 0 after your DialogBoxParam if you quit the program in the Dialog Procedure with ExitProcess when the program receives the message WM_CLOSE.
Title: Re: DialogBoxParam bug on Windows XP
Post by: Shantanu Gadgil on June 16, 2006, 08:47:05 AM
Hi, I have not checked the dialog styles or anything, but some immediate things which are visible... :)

invoke DialogBoxParam, hInstance, DIALOG_1, NULL, addr DlgProc, NULL
invoke ExitProcess, 0 ; put this line here
.
.
.
DlgProc proc hwndDlg:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
.IF uMsg==WM_CLOSE
;invoke ExitProcess, 0 ;change this line to
invoke EndDialog,hWndDlg,0
.ELSE
xor eax,eax ;mov eax, FALSE
ret
.ENDIF

mov eax,TRUE
ret
DlgProc endp


Hope this helps!