Hi all: I am really new to The win32 assembly and have a question about calling a proc. It is likely a stupid question but here goes. I am making a Amateur Radio Logbook and it is dialog based. To this point all works fine except for my calling procedure. There is more program ahead of this. ----------------------------------------------------------- .elseif wParam == 1900 szText TheMsg,"Bob's Logbook",13,10 invoke MessageBox,hWin,ADDR TheMsg,ADDR szDisplayName,MB_OK .endif .if wParam== 500 ;Where I call from call CAddit .elseif wParam== 501 szText TheMsg2,"Delete procedure goes here." invoke MessageBox,hWin,ADDR TheMsg2,ADDR szDisplayName,MB_OK ;This is the Proc called from above. ---------------------------------------------------------- CAddit proc hWin :DWORD, uMsg :DWORD, wParam :DWORD, lParam :DWORD szText TheMsg1,"Add procedure goes here." invoke MessageBox,hWin,ADDR TheMsg1,ADDR szDisplayName,MB_OK ret CAddit endp ---------------------------------------------------------- When I press the Add button on my project nothing happens. All the other buttons pull up the Message boxes.Eventually the add prodedure will go in this CAddit Proc. What am I doing wrong? Thanks in advance. Bob.
Posted on 2001-01-25 19:05:00 by BobMcK
Okay, a bit of a blind blunder here, but don't feel bad. I think everyone has made a similar mistake a thousand times over. :) .elseif wParam == 1900 szText TheMsg,"Bob's Logbook",13,10 invoke MessageBox,hWin,ADDR TheMsg,ADDR szDisplayName,MB_OK ; So far so good. .endif .if wParam== 500 ;Where I call from call CAddit ; Whoops! Where's hWin? Where's uMsg? You must remember ; to pass parameters when you use them in your routines. Ie: ; ; invoke CAddit,hWin,uMsg,wParam,lParam ; ; Assuming those are your parameters to be passed .elseif wParam== 501 szText TheMsg2,"Delete procedure goes here." invoke MessageBox,hWin,ADDR TheMsg2,ADDR szDisplayName,MB_OK ;This is the Proc called from above. CAddit proc hWin :DWORD, uMsg :DWORD, wParam :DWORD, lParam :DWORD ; You might need to add a PROTO at the beginning of your ; program in order to invoke this routine. szText TheMsg1,"Add procedure goes here." invoke MessageBox,hWin,ADDR TheMsg1,ADDR szDisplayName,MB_OK ret CAddit endp
Posted on 2001-01-25 20:15:00 by Racso
Racso: Thank you for your help on the calling a Message box. I sure overlooked the obvious. I did a lot of assembly for dos, some years ago and find Win32 so much different. I think this will be a fun project. I will likely need more help before it is finished. Thanks Bob.
Posted on 2001-01-25 22:20:00 by BobMcK