This documentation is archived and is not being maintained.


Binds the calling object's default simple bound property (such as an edit control), as marked in the type library, to the underlying cursor that is defined by the DataSource, UserName, Password, and SQL properties of the data-source control.

void BindDefaultProperty( 
   DISPID dwDispID, 
   VARTYPE vtProp, 
   LPCTSTR szFieldName, 
   CWnd * pDSCWnd  


Specifies the DISPID of a property on a data-bound control that is to be bound to a data-source control.


Specifies the type of the property to be bound — for example, VT_BSTR, VT_VARIANT, and so on.


Specifies the name of the column, in the cursor provided by the data-source control, to which the property will be bound.


Points to the window that hosts the data-source control to which the property will be bound. Call GetDlgItem with the resource ID of the DCS's host window to retrieve this pointer.

The CWnd object on which you call this function must be a data-bound control.

BindDefaultProperty might be used in the following context:

BOOL CMyDlg::OnInitDialog()


CWnd* pMyBound = GetDlgItem(IDC_MYBOUNDCTRL1);
pMyBound->BindDefaultProperty(0x1, VT_BSTR, _T("ContactFirstName"), pDSC);


	return TRUE;

Header: afxwin.h