CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2001
    Location
    germany
    Posts
    772

    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.

  2. #2
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

    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

  3. #3
    Join Date
    Aug 2001
    Location
    germany
    Posts
    772

    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.

  4. #4
    Join Date
    Aug 2004
    Location
    Chennai, India.
    Posts
    380

    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

  5. #5
    Join Date
    Aug 2001
    Location
    germany
    Posts
    772

    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.

  6. #6
    Join Date
    Aug 2001
    Location
    germany
    Posts
    772

    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
  •  





Click Here to Expand Forum to Full Width

Featured