Hello
I have a proc that loads a picture and then put in a variabel:



LoadPicture proc path:DWORD,pathM:DWORD,Dest:DWORD,MaskDest:DWORD
invoke LoadImage,NULL,path,IMAGE_BITMAP,0,0,LR_LOADFROMFILE
mov Dest,eax
invoke LoadImage,NULL,pathM,IMAGE_BITMAP,0,0,LR_LOADFROMFILE ;load mask
mov MaskDest,eax

ret
LoadPicture endp


i want to do like this



.data?
Pic dd ?
PicMask dd ?
...
.code
...
invoke LoadPicture,addr PicPath1,addr PicPathMask1,Pic,MaskPic
...

But it doesn't work as planned :rolleyes:
i cant do like this:


invoke LoadImage,NULL,pathM,IMAGE_BITMAP,0,0,LR_LOADFROMFILE ;load mask
mov MaskDest,eax

How should i do to get it to mov eax to my PicMask?

sorry for my bad english :(
Posted on 2004-03-10 13:51:57 by bj1500
The normal way to do this is to pass a pointer to the variable for example:

LoadPicture proc path, pathM, pDest, pMaskDest

invoke LoadImage, NULL, path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE
mov ecx,pDest
mov [ecx],eax
invoke LoadImage, NULL, pathM, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE
mov ecx,pMaskDest
mov [ecx],eax

ret
LoadPicture endp


invoke LoadPicture, addr PicPath1, addr PicPathMask1, OFFSET Pic, OFFSET MaskPic
Posted on 2004-03-10 14:40:14 by donkey
great :alright:
Posted on 2004-03-10 14:57:07 by bj1500