Browse Directory problem in XP
Hi
I am having the following code to browse a directory. Everything works fine on win2000 but it looks like on xp the app hangs. I don't have an xp version now to try to debug so I thought maybe someone knows some basic problem about the code beforehand...
Code:
void CPhraseTableGeneratorDlg::OnInputDirBtn()
{
char szPath[1000];
BROWSEINFO bi;
memset(&bi, 0, sizeof(bi));
bi.hwndOwner = m_hWnd;
bi.lpszTitle = "Please select an input folder";
LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi);
SHGetPathFromIDList(pIDL,szPath);
dirPath = (CString)szPath;
SetCurrentDirectory((LPCTSTR)dirPath);
}
Please rate if it helps!
* The second mouse gets the cheese.
* Birthdays are good for you. The more you have, the longer you live.
* Always keep your words soft and sweet, just in case you have to eat them.
* Always read stuff that will make you look good if you die in the middle of it.