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);
}
Re: Browse Directory problem in XP
Hi,
At least the CString dirPath is undeclared. Fix by doing this;
Code:
CString dirPath = (CString)szPath;
When fixed this it works for me ;)
Regards,
Laitinen
Re: Browse Directory problem in XP
thanks for your reply but this is already declared in the header file.
Re: Browse Directory problem in XP
Thats working fine for me too.. both in debug and release too......
the problem may not be bcoz of this browse code,
I feel it may be bcoz of something else...
Thanx
dwurity
Re: Browse Directory problem in XP
thanks too, that sounds bad :confused:
i guess I'll have to try to find a machine where it hangs.. dammit!
I thought it might be because i had linked the libraries dynamically and there could be a mismatch in a dll version on the guy's machine but after i linked them statically the problem happened again.
anyway thanks again for trying!
:wave:
Re: Browse Directory problem in XP
Could this be related to some asian language pack problem? the guy who has this error is located in korea.