look this code:


CMYMETHOD MACRO MName:REQ
LOCAL sz1, sz2
sz2 CATSTR <_&MName>,<Pto>
sz1 typedef PTR &sz2
&MName sz1 ?
ENDM

_messagebPto TYPEDEF PROTO :DWORD,:dword,:DWORD,:dword
_otherPto TYPEDEF PROTO :DWORD,:dword

winapi struct
CMYMETHOD messageb
CMYMETHOD other
winapi ends

.data
pmessage dd 0
pother dd 0

.code
start:

...

szText szuserdll,"User32.dll"
szText szmsgbox,"MessageBox"
invoke LoadLibrary,addr szuserdll
invoke GetProcAddress,eax,addr szmsgbox
mov pmessage,eax

lea esi,pmessage
assume esi:ptr winapi
invoke .messageb,hWnd,addr szmsgbox,0,MB_OK
assume esi:nothing

...

end start


i run it ,but error !
can you tell me where is error ?
Posted on 2003-08-31 11:49:46 by dexter
I would suggest doing some error checking, especially returncode from GetProcAddress. Possibly function MessageBox doesnt exist (MessageBoxA instead).
Posted on 2003-09-01 00:14:01 by japheth
you are right ,i got why.
Posted on 2003-09-01 02:53:40 by dexter