Hi Y'all
I also had problems using DlgDirList and searched for 2 days on the solution.
I came across this site from MSDN
http://msdn.microsoft.com/en-us/library/windows/desktop/hh298372(v=vs.85).aspx[
^]
and I saw that in the InitDialog part of the code they used DlgDirList.
So I copied this part of the code ofcourse with variable declarations into my own program :
void CTwoFormsDlg::FillList()
{
PTSTR pszCurDir;
TCHAR achBuffer[MAX_PATH];
pszCurDir = (PTSTR)spathOnly.GetString();
SetCurrentDirectory(pszCurDir); // First Set the directory to path
pszCurDir = achBuffer;
GetCurrentDirectory(MAX_PATH, pszCurDir); // Then get the directory path
DlgDirList(pszCurDir, CL_SECLIST, 0, 0);}
Removed SetFocus because this did not work and after all that searching I had no intention to go and look for that again so that you have to figure out yourself.
But the sub works when I press a button that has a call to that function.
Hope this helps.
Changed some things in the code where spathOnly is declared in MyAppDlg.h , CL_SECLIST is de name of the list control.
Greetz
Richard