I get an error in the following code from Iczelion's tutorial on Dialog Boxes. I'm sure I typed everything write, and I've traced through my .IF ... .ENDIF blocks and I can't find the error. THe error is: C:\masm32\BIN\Proj\dialog_1.asm(115) : fatal error A1010: unmatched block nesting : WndProc



wndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
.IF uMsg == WM_DESTROY
invoke PostQuitMessage, NULL
.ELSEIF uMsg == WM_COMMAND
mov eax, wParam
.IF lParam == 0
.IF ax == IDM_GETTEXT
invoke GetDlgItemText, hWnd, IDC_EXIT, ADDR buffer, 512
invoke MessageBox, NULL, ADDR buffer, ADDR AppName, MB_OK
.ELSEIF ax == IDM_CLEAR
invoke SetDlgItemText, hWnd, IDC_EXIT,NULL
.ELSE
invoke DestroyWindow, hWnd
.ENDIF
.ELSE
mov edx, wParam
shr edx, 16
.IF dx == BN_CLICKED
.IF ax == IDC_BUTTOM
invoke SetDlgItemText, hWnd, IDC_EXIT, ADDR TestString
.ELSEIF ax == IDC_EXIT
invoke SendMessage, hWnd, WM_COMMAND, IDM_EXIT,0
.ENDIF
.ENDIF
.ENDIF
.ELSE
invoke DefWindowProc, hWnd, uMsg, wParam, lParam
ret
.ENDIF
xor eax, eax
ret
WndProc endp


This is driving me crazy. It should work, but it doesn't. Anyone know the problem?
Posted on 2002-08-31 22:27:20 by devilmech
Dunno...

Did you try renaming the wndProc to WndProc ?



wndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
...
WndProc endp


Try that !
Posted on 2002-08-31 22:54:25 by JimmyClif
Yes, that would have helped. I wrote all that earlier while under the influence, so after correcting a few errors, it now compiles. But it doesn't show up on screen. I'm now trying some stuff to see what is wrong. Do you know of a utility that compares two text files and outputs the lines that are different? This might help me
Posted on 2002-09-01 04:26:28 by devilmech
Only one I know of is FC

Type "command" in Start -> Run
Then type "FC /?" for options
Posted on 2002-09-01 09:29:13 by JimmyClif