Invoke
Listview proc
local lvc:LVCOLUMN
mov lvc.imask,LVCF_TEXT+LVCF_WIDTH
mov lvc.pszText, offset szText
mov lvc.lx,150
invoke SendMessage, hListv, LVM_INSERTCOLUMN, 0 , addr lvc
Listview endp
CALL
Listview proc
local lvc:LVCOLUMN
mov lvc.imask,LVCF_TEXT+LVCF_WIDTH
mov lvc.pszText, offset szText
mov lvc.lx,150
push offset lvc
push 0
push LVM_INSERTCOLUMN
push hListv
call SendMessage
Listview endp
The first code work but not the second...
Are the 2 codes identical ??
If i use :
lea eax, lvc
push eax
push 0
push LVM_INSERTCOLUMN
push hListv
call SendMessage
This code work ! Why ?
thanx ;)
Listview proc
local lvc:LVCOLUMN
mov lvc.imask,LVCF_TEXT+LVCF_WIDTH
mov lvc.pszText, offset szText
mov lvc.lx,150
invoke SendMessage, hListv, LVM_INSERTCOLUMN, 0 , addr lvc
Listview endp
CALL
Listview proc
local lvc:LVCOLUMN
mov lvc.imask,LVCF_TEXT+LVCF_WIDTH
mov lvc.pszText, offset szText
mov lvc.lx,150
push offset lvc
push 0
push LVM_INSERTCOLUMN
push hListv
call SendMessage
Listview endp
The first code work but not the second...
Are the 2 codes identical ??
If i use :
lea eax, lvc
push eax
push 0
push LVM_INSERTCOLUMN
push hListv
call SendMessage
This code work ! Why ?
thanx ;)
There are two basic kinds of variables: those placed on stack and those placed in miscellaneous data sections.
Variables placed in data section have permanent static placement, so an 'offset' operator could be used to obtain their address during assembly phase.
Variables placed on stack on other hand have dynamic address which can be determined only at a run time.
That 'addr' in your first example actually expands into 'lea eax, lvc / push eax'
('lea' = load effective address).
Variables placed in data section have permanent static placement, so an 'offset' operator could be used to obtain their address during assembly phase.
Variables placed on stack on other hand have dynamic address which can be determined only at a run time.
That 'addr' in your first example actually expands into 'lea eax, lvc / push eax'
('lea' = load effective address).