| Home | Table of Contents | Please view with Internet Explorer (version 5.00 or higher) and enable scripting. For reasons, see Browsing This Web Site. |
This function finds the index for a given item in a given DPA.
int
DPA_GetPtrIndex (
HDPA pdpa,
const void *p);
The pdpa argument provides a handle to the DPA.
The p argument provides a pointer to the item, or is NULL for an empty item.
The function returns a 0-based index for the given item if successful, else DPA_ERR (-1).
The function searches the pointer array for the first occurrence of the given pointer. It returns the corresponding 0-based index.
The function fails trivially if the DPA handle is NULL or if the DPA has no pointer array.
A variation is known for an early implementation. Version 4.00 merely assumes that the DPA handle is not NULL.
The DPA_GetPtrIndex function is exported from COMCTL32.DLL as ordinal 333 in version 3.50 and higher.
Though this function dates from as long ago as 1995, it was still not documented by Microsoft in the MSDN Library at least as late as the CD edition dated January 2004.
This function has, however, got documented since then (in 2006 or perhaps some time during 2005). This article now uses Microsoft’s nomenclature.