Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.


The DDX_LBIndex function manages the transfer of int data between a list box control in a dialog box, form view, or control view object and an int data member of the dialog box, form view, or control view object.

void AFXAPI DDX_LBIndex(
   CDataExchange* pDX,
   int nIDC,
   int& index 



A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.


The resource ID of the list box control associated with the control property.


A reference to a member variable of the dialog box, form view, or control view object with which data is exchanged.

When DDX_LBIndex is called, index is set to the index of the current list box selection. If no item is selected, index is set to -1.

For more information about DDX, see Dialog Data Exchange and Validation.

Community Additions

© 2015 Microsoft