Hi When i want to display a dialog box (template in rc), it always returns -1 (i have check this in debugger) so it can't be displayed. Does anybody know why? Where to look to find a problem? I can't find it. code: ----- ...

OProgramu db "OProgramu",0	; the name of dialog box in .RC file
...
.IF uMsg==WM_COMMAND
	mov eax,wParam
	.IF eax==1000	; 'About' item in menu 'Help'
            mov eax,OFFSET OProgramuProc
            invoke DialogBoxParam,hInstance,ADDR OProgramu,hWnd,eax,0
            xor eax,eax
            ret
	.ENDIF

...
OProgramuProc PROC hDlg:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
    .IF uMsg==WM_INITDIALOG
        mov eax,TRUE
        ret
    .ELSEIF uMsg==WM_COMMAND
        mov eax,wParam
        .IF eax==1000
            invoke EndDialog,hDlg,TRUE
	    ret
        .ENDIF
    .ELSE
	mov eax,FALSE
	ret
    .ENDIF
    mov eax,TRUE
    ret
OProgramuProc ENDP
Thank you all greetings This message was edited by hutch--, on 6/15/2001 9:17:41 PM
Posted on 2001-06-13 12:03:00 by stanks
Hi, Are the the WORD's in your proc a typo? Your code looks ok I'll need to see more starting yith your WinProc and your Dialog Template. Ewayne
Posted on 2001-06-13 17:40:00 by Ewayne
There a several possible reasons for unsuccessful execution of DialogBox(). If I were You I would try: 1. setting a breakpoint in my dialogproc (WM_INITDIALOG) 2. if this breakpoint is never executed, I would try to load the dialog box resource explicitly with the following code: invoke FindResource, hInstance, addr resourcename, 5 3. If this call returns NULL, I would examine the "last error" (get this with GetLastError()).
Posted on 2001-06-14 16:38:00 by Japheth
Hey, u wanna may be post your resource code ? may be there is something wrong in it, cuz you said it doesn't load it. Just an idea though Regards
Posted on 2001-06-15 14:25:00 by Typhoon
stanks, I just added the formatting options to your post so it is easier to read. First thing is to see if the resource template builds OK. drv:\path\RC /v YourRC.RC Use the /v switch to see if the build is working. I personally find the use of ID numbers much more reliable than using strings to name dialog boxes so this is worth a try. Regards, hutch@pbq.com.au
Posted on 2001-06-15 21:24:00 by hutch--
Thank you very much guys This is the solution that hutch-- told me. When i change the name of dialog in .rc to number everything works ok now. Again thank you hutch-- and thanks to all guys that reply. Greetings
Posted on 2001-06-16 06:12:00 by stanks