int DlgDirListComboBox( LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType );
Example
// If pDialog points to a CDialog object with a combo box
// with the identifier IDC_DIRBOX, this call will populate
// the box with only the non-hidden subdirectories in the root
// directory of the C:/ drive.
pDialog->DlgDirListComboBox(_T("C://"), IDC_DIRBOX, 0,
DDL_EXCLUSIVE | DDL_DIRECTORY);
would cause crash, becase
lpPathSpec
Points to a null-terminated string that contains the path or filename. DlgDirListComboBox modifies this string, which should be long enough to contain the modifications.
Correct Usage
TCHAR szPath [MAX_PATH] = _T("C://") ;
pDialog->DlgDirListComboBox(szPath, IDC_DIRBOX, 0,
DDL_EXCLUSIVE | DDL_DIRECTORY);