PDA

Click to See Complete Forum and Search --> : Getting STRUCTURE info from a pointer


JSlavin0828
Jun 22nd, 2000, 06:23 AM
i am subclassing, and the lParam ends up returning a pointer to a structure of type MDICREATESTRUCTURE..
i want to know how i can access data in this structure when all i have is a pointer???
any ideas?
thanks
jeffrey

Sam Finch
Jun 22nd, 2000, 07:49 AM
use the CopyMemory API

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

and put this in your substitute window procedure



Dim uMDIStruct As MDICREATESTRUCTURE

CopyMemory uMDIStruct, ByVal lParam, LenB(uMDIStruct)



then make all your changes to uMDIStruct and copy them back to lParam with
CopyMemory ByVal lParam, uMDIStruct, LenB(uMDIStruct)




Hope this helps