Progress
Language Reference
GET-POINTER-VALUE Function
Returns (as an INTEGER value) the address of (or pointer to) the memory region associated with the specified MEMPTR variable.
SYNTAX
memptr-var
A reference to a variable defined as MEMPTR. If the variable is uninitialized (has no associated memory region), the function returns 0.
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: 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).NOTES
- MEMPTR structures are initialized using the SET-SIZE statement.
- For more information on using the MEMPTR data type, see the Progress External Program Interfaces manual.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |