Basic question about building a stack frame... I finally had some time to
play around with them last night after searching the boards and the net
for some examples and after a little thought I came up with this so far:



; new function test
NewFunc:
enter 8, 0
virtual at ebp-8
hwnd: dd ?
wPE: dd ?
end virtual

; main code here

leave
retn 8


This template function compiles with no issues and is callable in this syntax:

push <arg1>
push <arg2>
call NewFunc

However if I try and use the macro invoke I get this error:

stdcall [3]:
invoke NewFunc, 0, 0
error: operand size not specified.

I *thought* that after invoke expanded it would be the exact same code.
Am I missing something important in my declaration? Basically I dont know
what the assembler is asking for so I am stuck... :rolleyes:

Thanks for any replys in advance :grin:
Posted on 2002-08-15 08:34:23 by Graebel
You should call it this way: "stdcall NewFunc, 0, 0", because "invoke NewFunc, 0, 0" is equal to "stdcall , 0, 0" (it wants size override for because NewFunc is not-sized label). You could use invoke when NewFunc was a dword variable containing the address of function.
Posted on 2002-08-15 09:27:47 by Tomasz Grysztar
Ahh that makes since. Hmm, is there a way to create a sized-label then? ;)

I think I will play with this some more to try and figure it out on my own,
but if I fail I figure I can just come back for this part and not repost...

Thanks Privalov!
Posted on 2002-08-15 14:41:25 by Graebel