|
-
February 1st, 2007, 09:20 AM
#1
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.
-
February 1st, 2007, 10:01 AM
#2
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
-
February 1st, 2007, 10:03 AM
#3
Re: Browse Directory problem in XP
thanks for your reply but this is already declared in the header file.
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.
-
February 2nd, 2007, 12:00 AM
#4
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
-
February 2nd, 2007, 03:38 AM
#5
Re: Browse Directory problem in XP
thanks too, that sounds bad
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!
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.
-
February 2nd, 2007, 05:12 AM
#6
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.
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|