Page 1 of 1

Posted: Tue Oct 01, 2002 3:03 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.

I don't know a word of asm, but thanks to a post from el_Choni i understand a little how it works, my question is how do i get the return value from the function call?

For example:

msg=GetProcAddress_(LoadLibrary_("user32.dll"),"MessageBoxA")

Type=#MB_OK
caption=@"hello"
text=@"world"
hWnd=#null

push Type
push caption$
push text$
push hWnd
call msg

i want to do this to use the functions in shlwapi.dll (not supported by PB) without using the library.lib and to learn a little of asm too :)

Posted: Tue Oct 01, 2002 3:17 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.
Originally posted by Justin

I don't know a word of asm, but thanks to a post from el_Choni i understand a little how it works, my question is how do i get the return value from the function call?

For example:

msg=GetProcAddress_(LoadLibrary_("user32.dll"),"MessageBoxA")

Type=#MB_OK
caption=@"hello"
text=@"world"
hWnd=#null

push Type
push caption$
push text$
push hWnd
call msg

i want to do this to use the functions in shlwapi.dll (not supported by PB) without using the library.lib and to learn a little of asm too :)
I think it's returned in the register EAX, but i may be wrong as i don't do asm much myself.

Posted: Tue Oct 01, 2002 4:10 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.

It works! Thanks for your fast reply.

msg=GetProcAddress_(LoadLibrary_("user32.dll"),"MessageBoxA")

Type=#MB_OKCANCEL
caption=@"hello"
text=@"world"
hWnd=#null
r.l=0 ;result

push Type
push caption
push text
push hWnd
call msg
mov r,eax

MessageRequester("",Str(r),0)

Like i said a don't know asm, maybe some experienced coder could tell us if there is something wrong using this, or something i should take care about with?

Posted: Tue Oct 01, 2002 4:47 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

Should work. Tested with my version, it works. No problem. You should free the library after use too. FreeLibrary_() I guess

Fred - AlphaSND

Posted: Tue Oct 01, 2002 6:13 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.

Thaks Fred, i noticed that if i put it inside a procedure it does not work, i use a gosub to use the routine several times with different parameters and then i free the library, i think is ok.

Btw, i found a very interesting page about ASM and Win32 programming:

http://www.eskimo.com/~htak/win32asm/win32asm.htm

Posted: Tue Oct 01, 2002 7:23 pm
by BackupUser
Restored from previous forum. Originally posted by Berikco.
Originally posted by Justin
Btw, i found a very interesting page about ASM and Win32 programming:
http://www.eskimo.com/~htak/win32asm/win32asm.htm
Thanks Justin, it's in my favorits :)

I'm trying a little inline asm also, i whas using asm without knowing, 'INC a' is the command in GFA basic(i used before) to add 1 to a, so it whas in the sources i translated. But i whas wondering why my app whas not working....inline asm whas off :)

Regards,

Berikco

http://www.benny.zeb.be