GET-POINTER-VALUE function
Returns, as an INT64 value, the address of (or pointer to) the memory region associated with the specified MEMPTR variable. The returned value is based on whether the platform supports 64-bit pointers or 32-bit pointers. On a 32-bit platform, the value never gets bigger than 2GB.
Note: Does not apply to SpeedScript programming.Syntax
memptr-var
ExampleThis function is particularly useful when building a structure in an MEMPTR region that references other MEMPTR regions. It allows you to obtain the pointer to one MEMPTR region and store it in the structure you create in another MEMPTR region. The following example allocates three memory regions-for a BITMAPINFO structure, a BITMAPINFOHEADER structure, and an RGB color array. It then uses the GET-POINTER-VALUE function together with the PUT-LONG statement to store pointers to the BITMAPINFOHEADER structure and an RGB color array in the BITMAPINFO structure. These structures describe a device-independent bitmap for Windows dynamic link library (DLL) routines. For more information on these bitmap structures, see your Windows Software Development Kit documentation.
Note: The following example only works on a 32-bit machine because it leaves space for 4 bytes for the pointer values. On a 64-bit machine, you would have to allocate 8 bytes of space.
Note: Before using structures such as these, you must initialize them according to your DLL requirements. For example, the biBitCount segment of the bitmapinfoheader must be set to 4 to specify the number of possible colors available in the RGB color array (16).NotesSee alsoPUT-INT64 statement, PUT-LONG statement, SET-SIZE statement,
OpenEdge Release 10.2B
|