Hi guys,
How to i pass the address of a pointer to a procedure. That is, the procedure parameter has to be a pointer to a pointer.
one proc
local point:ptr byte
invoke two, addr point
ret
one endp
two proc ppt: ?? how do i create here
ret
two endp
Clark
A pointer is just some data, a number with no meaning until it is given a context.
So store the location of your "pointer", and then pass the address in memory of that memory location. Then you will be passing a pointer to a pointer!
As far as you are concerned, in a 32bit environment, a pointer is a DWORD. It will always be a DWORD, as the memory address is 32bits long. For readability you can TYPEDEF your argument to a DWORD, but once you get used to using DWORD, WORD, and BYTE for pretty much everything (bar REALs), you are sorted.
Best thing to do to avoid confusion is to adopt some naming convention (start all pointers with a lower case p ("pMyArry"), and use other letters for other stuff, like h for handles ("hWnd"), it avoids confusion when reading your code).
So your code will be:
one proc
local point:ptr byte
invoke two, addr point
ret
one endp
two proc ppt:DWORD
ret
two endp
Technically the "local point:ptr byte" is a DWORD, because its a pointer!
Mirno