FolderBrowserDialog won't open sometimes

  • Thread starter Thread starter Ray Mitchell
  • Start date Start date
R

Ray Mitchell

Hello,

I'm using VS2005 Pro & WinXP. I have the following code to open a
FolderBrowserDialog, with its initial path set to the directory specified by
"oldDirectoryName", which does exist.

FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
folderBrowserDialog.ShowNewFolderButton = allowCreateNewDirectory;
folderBrowserDialog.SelectedPath = oldDirectoryName;
DialogResult result = folderBrowserDialog.ShowDialog();
if (result == DialogResult.OK)
return folderBrowserDialog.SelectedPath;
return oldDirectoryName;

When the folderBrowserDialog.ShowDialog(); statement is executed sometimes
the dialog opens and works perfectly but a large percentage of the time it
never opens and my application just hangs until I kill it. I'm running in
the debug mode and I've tried stepping into that function but it will go no
farther and just hangs without showing me any more code. Any ideas?

Thanks,
Ray
 
hi Ray,

Ray said:
When the folderBrowserDialog.ShowDialog(); statement is executed sometimes
the dialog opens and works perfectly but a large percentage of the time it
never opens and my application just hangs until I kill it. I'm running in
the debug mode and I've tried stepping into that function but it will go no
farther and just hangs without showing me any more code. Any ideas?
Sure? This dialog needs to enumerate folders first. When having a lot of
mapped and unreachable devices this may last its time...


mfG
--> stefan <--
 
Stefan Hoffmann said:
hi Ray,


Sure? This dialog needs to enumerate folders first. When having a lot of
mapped and unreachable devices this may last its time...


mfG
--> stefan <--

Well, I gave it 30 minutes then killed it. If I open a new instance of
Windows Explorer it might take a few seconds to look at the sime directory
but never anywhere near 30 minutes. Of course maybe I'm comparing apples and
oranges here.
 
hi Ray,

Ray said:
Well, I gave it 30 minutes then killed it. If I open a new instance of
Windows Explorer it might take a few seconds to look at the sime directory
but never anywhere near 30 minutes. Of course maybe I'm comparing apples and
oranges here.
Does it run well, when not being in debug mode. Thirty minutes is sure
too long.


mfG
--> stefan <--
 
Does your main function have the STAThread attribute. This is necessary for
it to work correctly.

---------
- G Himangi, LogicNP Software http://www.ssware.com
Shell MegaPack: GUI Controls For Drop-In Windows Explorer like File/Folder
Browsing Functionality (.Net & ActiveX Editions).
EZNamespaceExtensions: Develop namespace extensions rapidly in .Net and
MFC/ATL/C++
EZShellExtensions: Develop all shell extensions,explorer bars and BHOs
rapidly in .Net & MFC/ATL/C++
 
Does your main function have the STAThread attribute. This is necessary for
it to work correctly.

---------
- G Himangi,   LogicNP Software      http://www.ssware.com
Shell MegaPack: GUI Controls For Drop-In Windows Explorer like File/Folder
Browsing Functionality (.Net & ActiveX Editions).
EZNamespaceExtensions: Develop namespace extensions rapidly in .Net and
MFC/ATL/C++
EZShellExtensions: Develop all shell extensions,explorer bars and BHOs
rapidly in .Net & MFC/ATL/C++

If there are too many files in some folder, or maybe too many sub
folders in a folder, windows explorer will hangs when open it. I guess
your suitation may be the same.
 
fyitang said:
If there are too many files in some folder, or maybe too many sub
folders in a folder, windows explorer will hangs when open it. I guess
your suitation may be the same.
Hi Ray,
Have you tried running this in release and seeing if you get the same
problem.
(sorry if you have tried this just ran across this post)
DH
 
Back
Top