i cant find my mistake: (adding 1 + 1 )
thanks
Ranma_at
[color=blue] .elseif eax==1005 [color=green];/* ADD */
[/color] invoke GetDlgItemInt,hWin,1001,0,TRUE
mov edx,[color=red]eax[/color]
invoke GetDlgItemInt,hWin,1002,0,TRUE
mov ebx,[color=red]eax[/color]
mov [color=red]eax[/color],edx
add [color=red]eax[/color],ebx
mov ecx,Result
mov [ecx],[color=red]eax[/color]
invoke dwtoa,Result, addr buffer
invoke MessageBox,hWin,addr buffer,offset AppName,MB_OK
[/color]
thanks
Ranma_at
mov ecx, offset Result
no, not working ;)
i get then no error but a wrong result
btw my Result is a local DWORD
lea eax, Result ;or
mov eax, offset Result
i get then no error but a wrong result
btw my Result is a local DWORD
would u like to post your program's source code? :)
You must save edx before the second GetDlgItemInt
thanks delight ;)
works fine now...
.elseif eax==1005 ;/* ADD */
invoke GetDlgItemInt,hWin,1001,0,TRUE
mov edx,eax
push edx
invoke GetDlgItemInt,hWin,1002,0,TRUE
pop edx
mov ebx,eax
mov eax,edx
add eax,ebx
lea ecx,Result
mov [ecx],eax
invoke dwtoa,Result, addr buffer
invoke MessageBox,hWin,addr buffer,offset AppName,MB_OK
works fine now...
Ranma_at,
ebx is preserved across WinAPI calls, so you might do this:
ebx is preserved across WinAPI calls, so you might do this:
.elseif eax==1005 ;/* ADD */
invoke GetDlgItemInt,hWin,1001,0,TRUE
[COLOR=teal];mov edx,eax
;push edx[/COLOR]
[color=blue]mov ebx,eax[/color]
invoke GetDlgItemInt,hWin,1002,0,TRUE
[COLOR=teal];pop edx
;mov ebx,eax
;mov eax,edx[/color]
add eax,ebx
lea ecx,Result
mov [ecx],eax
invoke dwtoa,Result, addr buffer
invoke MessageBox,hWin,addr buffer,offset AppName,MB_OK
Also remember to preserve EBX in the dialog proc:
DialogProc proc uses ebx hWin,uMsg,wParam,lParam
Thanks QvasiModo,
i forgot the preservation :rolleyes:
i forgot the preservation :rolleyes: