DPA_SortedInsertPtr macro

Inserts a new item before or after a specified existing item.

Syntax


int DPA_SortedInsertPtr(
  HDPA pdpa,
  void *pFind,
  int iStart,
  PFNDPACOMPARE pfnCmp,
  LPARAM lParam,
  UINT options,
  void *pitem
);

Parameters

pdpa

Type: HDPA

A handle to a DPA.

pFind

Type: void*

An item pointer which is used to determine the insertion point for the new item (see Remarks).

iStart

Type: int

The index in the DPA at which to begin searching for pFind.

pfnCmp

Type: PFNDPACOMPARE

A pointer to the comparison function. See PFNDPACOMPARE or PFNDPACOMPARECONST for the comparison function prototype.

lParam

Type: LPARAM

An additional parameter used to pass information to the comparison function pointed to by pfnCmp.

options

Type: UINT

The insertion point. Must be one of the following values.

ValueMeaning
DPAS_INSERTBEFORE

Insert the new item before the pFind item.

DPAS_INSERTAFTER

Insert the new item after the pFind item.

 

pitem

Type: void*

A pointer to the item that is to be inserted.

Return value

Returns the index of the new item or -1, if the insert action fails.

Remarks

Note  This macro wraps the DPA_InsertPtr and DPA_Search functions.

The DPAS_SORTED flag is included in options by default to indicate that the DPA is sorted.

See function DPA_Search for additional information on how the pFind item is located. The new item is inserted before or after the pFind item according to the options parameter. The pFind parameter need not exist in the DPA. If it does not exist in the DPA, then the new item is inserted where pFind would have been had it been inserted in the DPA in sorted order.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Commctrl.h

 

 

Community Additions

ADD
Show:
© 2014 Microsoft