By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,423 Members | 1,601 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,423 IT Pros & Developers. It's quick & easy.

FolderBrowserDialog crashes on Windows 2000

P: n/a
FolderBrowserDialog crashes on my Windows 2000 computer.

Here is a C# test program:

using System;
using System.Windows.Forms;

public class TestForm : Form {
FolderBrowserDialog folderBrowserDlg;
OpenFileDialog openFileDlg;
String folderName;
String fileName;

MainMenu mainMenu;
MenuItem mi_Browse;
MenuItem mi_Open;
MenuItem mi_FileMenu;
MenuItem mi_Exit;

public TestForm () {
mainMenu = new MainMenu();

mi_FileMenu = new MenuItem();
mi_FileMenu.Text = "&File";

mi_Browse = new MenuItem();
mi_Browse.Text = "&Select Directory...";
mi_Browse.Shortcut = Shortcut.CtrlS;
mi_Browse.Click += new EventHandler (MI_Browse_OnClick);

mi_Open = new MenuItem();
mi_Open.Text = "&Open File...";
mi_Open.Shortcut = Shortcut.CtrlO;
mi_Open.Click += new EventHandler (MI_Open_OnClick);

mi_Exit = new MenuItem();
mi_Exit.Text = "E&xit Test...";
mi_Exit.Shortcut = Shortcut.CtrlX;
mi_Exit.Click += new EventHandler (MI_Exit_OnClick);

mainMenu.MenuItems.Add (mi_FileMenu);
mi_FileMenu.MenuItems.Add (mi_Browse);
mi_FileMenu.MenuItems.Add (mi_Open);
mi_FileMenu.MenuItems.Add (mi_Exit);

folderBrowserDlg = new FolderBrowserDialog ();
openFileDlg = new OpenFileDialog ();

Menu = mainMenu;
Text = "Dialog Test Form";
}

void MI_Browse_OnClick (object sender, EventArgs e)
{
DialogResult result;

result = folderBrowserDlg.ShowDialog ();
if (result == DialogResult.OK) {
folderName = folderBrowserDlg.SelectedPath;
}
}

void MI_Open_OnClick (object sender, EventArgs e)
{
DialogResult result;

result = openFileDlg.ShowDialog ();
if (result == DialogResult.OK) {
fileName = openFileDlg.FileName;
}
}

void MI_Exit_OnClick (object sender, EventArgs e)
{
Close ();
}

[STAThread]
static void Main () {
Application.Run (new TestForm ());
}
}

Under Windows 2000, 4 of 10 times, it crashed first time I
tried to display the FolderBrowserDialog. I ran the tests
right after rebooting. To run the test, start the program,
and press Ctrl-S. The times it did not immediately crash,
if I kept bringing up the FolderBrowserDialog, it crashed
pretty soon. OpenFileDialog (included in test program)
does not crash on Windows 2000. FolderBrowserDialog
has not crashed on Windows XP computer.

When FolderBrowserDialog crashes, it's immediately after it
displays the dialog. The dialog appears normal.

An error message window appears - 'The instruction at
"address" referenced memory at "address". The memory
could not be "read". The two addresses are always the same.
After closing error message window, a second error message
window appears - 'program has generated errors and will be
closed by Windows. You will need to restart the program.
An error log is being created.' The log file is a huge
binary file. No exception gets written to the console.

It would surprise me if FolderBrowserDialog crashed Windows
2000, and nobody reported it before. However, I have no way
of knowing at this point. The Windows 2000 computer I tested
on is pretty stable. Sometimes, Windows Explorer does crash
on the computer, but it's been more than a month.

To help figure this out:

* Has FolderBrowserDialog crashing been reported before,
either on Microsoft site or elsewhere? I could not find.

* Can someone run same test on their Windows 2000 multiple
times, and post whether it crashes or not?

* Has anyone used FolderBrowserDialog in a desktop .NET
application, and tested it to be stable with Windows 2000?

Many thanks,
Daniel Goldman

Nov 17 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Hi Daniel,

I have compiled your code on Windows 2000, run it several times, and it does
exactly what it should. No crahses after about 20 times of using it.

Hope this helps

Publicjoe

C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html - 71
Chapters
VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html - 28
Chapters
C++ Ebook at http://www.publicjoe.f9.co.uk/cppt/samples/ebook.html - 8
Chapters
Java Ebook at http://www.publicjoe.f9.co.uk/java/samples/ebook.html - 2
Chapters
<hh******@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
FolderBrowserDialog crashes on my Windows 2000 computer.

Here is a C# test program:

using System;
using System.Windows.Forms;

public class TestForm : Form {
FolderBrowserDialog folderBrowserDlg;
OpenFileDialog openFileDlg;
String folderName;
String fileName;

MainMenu mainMenu;
MenuItem mi_Browse;
MenuItem mi_Open;
MenuItem mi_FileMenu;
MenuItem mi_Exit;

public TestForm () {
mainMenu = new MainMenu();

mi_FileMenu = new MenuItem();
mi_FileMenu.Text = "&File";

mi_Browse = new MenuItem();
mi_Browse.Text = "&Select Directory...";
mi_Browse.Shortcut = Shortcut.CtrlS;
mi_Browse.Click += new EventHandler (MI_Browse_OnClick);

mi_Open = new MenuItem();
mi_Open.Text = "&Open File...";
mi_Open.Shortcut = Shortcut.CtrlO;
mi_Open.Click += new EventHandler (MI_Open_OnClick);

mi_Exit = new MenuItem();
mi_Exit.Text = "E&xit Test...";
mi_Exit.Shortcut = Shortcut.CtrlX;
mi_Exit.Click += new EventHandler (MI_Exit_OnClick);

mainMenu.MenuItems.Add (mi_FileMenu);
mi_FileMenu.MenuItems.Add (mi_Browse);
mi_FileMenu.MenuItems.Add (mi_Open);
mi_FileMenu.MenuItems.Add (mi_Exit);

folderBrowserDlg = new FolderBrowserDialog ();
openFileDlg = new OpenFileDialog ();

Menu = mainMenu;
Text = "Dialog Test Form";
}

void MI_Browse_OnClick (object sender, EventArgs e)
{
DialogResult result;

result = folderBrowserDlg.ShowDialog ();
if (result == DialogResult.OK) {
folderName = folderBrowserDlg.SelectedPath;
}
}

void MI_Open_OnClick (object sender, EventArgs e)
{
DialogResult result;

result = openFileDlg.ShowDialog ();
if (result == DialogResult.OK) {
fileName = openFileDlg.FileName;
}
}

void MI_Exit_OnClick (object sender, EventArgs e)
{
Close ();
}

[STAThread]
static void Main () {
Application.Run (new TestForm ());
}
}

Under Windows 2000, 4 of 10 times, it crashed first time I
tried to display the FolderBrowserDialog. I ran the tests
right after rebooting. To run the test, start the program,
and press Ctrl-S. The times it did not immediately crash,
if I kept bringing up the FolderBrowserDialog, it crashed
pretty soon. OpenFileDialog (included in test program)
does not crash on Windows 2000. FolderBrowserDialog
has not crashed on Windows XP computer.

When FolderBrowserDialog crashes, it's immediately after it
displays the dialog. The dialog appears normal.

An error message window appears - 'The instruction at
"address" referenced memory at "address". The memory
could not be "read". The two addresses are always the same.
After closing error message window, a second error message
window appears - 'program has generated errors and will be
closed by Windows. You will need to restart the program.
An error log is being created.' The log file is a huge
binary file. No exception gets written to the console.

It would surprise me if FolderBrowserDialog crashed Windows
2000, and nobody reported it before. However, I have no way
of knowing at this point. The Windows 2000 computer I tested
on is pretty stable. Sometimes, Windows Explorer does crash
on the computer, but it's been more than a month.

To help figure this out:

* Has FolderBrowserDialog crashing been reported before,
either on Microsoft site or elsewhere? I could not find.

* Can someone run same test on their Windows 2000 multiple
times, and post whether it crashes or not?

* Has anyone used FolderBrowserDialog in a desktop .NET
application, and tested it to be stable with Windows 2000?

Many thanks,
Daniel Goldman

Nov 17 '05 #2

P: n/a
I too just tried your code on a 2K SP4 machine with no ill results. Have you
been able to try it on any other 2K machines?

Brendan

"hh******@yahoo.com" wrote:
FolderBrowserDialog crashes on my Windows 2000 computer.

Here is a C# test program:

using System;
using System.Windows.Forms;

public class TestForm : Form {
FolderBrowserDialog folderBrowserDlg;
OpenFileDialog openFileDlg;
String folderName;
String fileName;

MainMenu mainMenu;
MenuItem mi_Browse;
MenuItem mi_Open;
MenuItem mi_FileMenu;
MenuItem mi_Exit;

public TestForm () {
mainMenu = new MainMenu();

mi_FileMenu = new MenuItem();
mi_FileMenu.Text = "&File";

mi_Browse = new MenuItem();
mi_Browse.Text = "&Select Directory...";
mi_Browse.Shortcut = Shortcut.CtrlS;
mi_Browse.Click += new EventHandler (MI_Browse_OnClick);

mi_Open = new MenuItem();
mi_Open.Text = "&Open File...";
mi_Open.Shortcut = Shortcut.CtrlO;
mi_Open.Click += new EventHandler (MI_Open_OnClick);

mi_Exit = new MenuItem();
mi_Exit.Text = "E&xit Test...";
mi_Exit.Shortcut = Shortcut.CtrlX;
mi_Exit.Click += new EventHandler (MI_Exit_OnClick);

mainMenu.MenuItems.Add (mi_FileMenu);
mi_FileMenu.MenuItems.Add (mi_Browse);
mi_FileMenu.MenuItems.Add (mi_Open);
mi_FileMenu.MenuItems.Add (mi_Exit);

folderBrowserDlg = new FolderBrowserDialog ();
openFileDlg = new OpenFileDialog ();

Menu = mainMenu;
Text = "Dialog Test Form";
}

void MI_Browse_OnClick (object sender, EventArgs e)
{
DialogResult result;

result = folderBrowserDlg.ShowDialog ();
if (result == DialogResult.OK) {
folderName = folderBrowserDlg.SelectedPath;
}
}

void MI_Open_OnClick (object sender, EventArgs e)
{
DialogResult result;

result = openFileDlg.ShowDialog ();
if (result == DialogResult.OK) {
fileName = openFileDlg.FileName;
}
}

void MI_Exit_OnClick (object sender, EventArgs e)
{
Close ();
}

[STAThread]
static void Main () {
Application.Run (new TestForm ());
}
}

Under Windows 2000, 4 of 10 times, it crashed first time I
tried to display the FolderBrowserDialog. I ran the tests
right after rebooting. To run the test, start the program,
and press Ctrl-S. The times it did not immediately crash,
if I kept bringing up the FolderBrowserDialog, it crashed
pretty soon. OpenFileDialog (included in test program)
does not crash on Windows 2000. FolderBrowserDialog
has not crashed on Windows XP computer.

When FolderBrowserDialog crashes, it's immediately after it
displays the dialog. The dialog appears normal.

An error message window appears - 'The instruction at
"address" referenced memory at "address". The memory
could not be "read". The two addresses are always the same.
After closing error message window, a second error message
window appears - 'program has generated errors and will be
closed by Windows. You will need to restart the program.
An error log is being created.' The log file is a huge
binary file. No exception gets written to the console.

It would surprise me if FolderBrowserDialog crashed Windows
2000, and nobody reported it before. However, I have no way
of knowing at this point. The Windows 2000 computer I tested
on is pretty stable. Sometimes, Windows Explorer does crash
on the computer, but it's been more than a month.

To help figure this out:

* Has FolderBrowserDialog crashing been reported before,
either on Microsoft site or elsewhere? I could not find.

* Can someone run same test on their Windows 2000 multiple
times, and post whether it crashes or not?

* Has anyone used FolderBrowserDialog in a desktop .NET
application, and tested it to be stable with Windows 2000?

Many thanks,
Daniel Goldman

Nov 17 '05 #3

P: n/a
Thanks for testing. No, I have not been able to try on any other
WIndows 2000 computers. Could anyone else please run the test
program for FolderBrowserDialog multiple times?

Daniel Goldman

Nov 17 '05 #4

P: n/a
How to show this dialogue from any folder?

like this:

folderBrowserDlg.RootFolder = @"C:\";

<hh******@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
FolderBrowserDialog crashes on my Windows 2000 computer.

Here is a C# test program:

using System;
using System.Windows.Forms;

public class TestForm : Form {
FolderBrowserDialog folderBrowserDlg;
OpenFileDialog openFileDlg;
String folderName;
String fileName;

MainMenu mainMenu;
MenuItem mi_Browse;
MenuItem mi_Open;
MenuItem mi_FileMenu;
MenuItem mi_Exit;

public TestForm () {
mainMenu = new MainMenu();

mi_FileMenu = new MenuItem();
mi_FileMenu.Text = "&File";

mi_Browse = new MenuItem();
mi_Browse.Text = "&Select Directory...";
mi_Browse.Shortcut = Shortcut.CtrlS;
mi_Browse.Click += new EventHandler (MI_Browse_OnClick);

mi_Open = new MenuItem();
mi_Open.Text = "&Open File...";
mi_Open.Shortcut = Shortcut.CtrlO;
mi_Open.Click += new EventHandler (MI_Open_OnClick);

mi_Exit = new MenuItem();
mi_Exit.Text = "E&xit Test...";
mi_Exit.Shortcut = Shortcut.CtrlX;
mi_Exit.Click += new EventHandler (MI_Exit_OnClick);

mainMenu.MenuItems.Add (mi_FileMenu);
mi_FileMenu.MenuItems.Add (mi_Browse);
mi_FileMenu.MenuItems.Add (mi_Open);
mi_FileMenu.MenuItems.Add (mi_Exit);

folderBrowserDlg = new FolderBrowserDialog ();
openFileDlg = new OpenFileDialog ();

Menu = mainMenu;
Text = "Dialog Test Form";
}

void MI_Browse_OnClick (object sender, EventArgs e)
{
DialogResult result;

result = folderBrowserDlg.ShowDialog ();
if (result == DialogResult.OK) {
folderName = folderBrowserDlg.SelectedPath;
}
}

void MI_Open_OnClick (object sender, EventArgs e)
{
DialogResult result;

result = openFileDlg.ShowDialog ();
if (result == DialogResult.OK) {
fileName = openFileDlg.FileName;
}
}

void MI_Exit_OnClick (object sender, EventArgs e)
{
Close ();
}

[STAThread]
static void Main () {
Application.Run (new TestForm ());
}
}

Under Windows 2000, 4 of 10 times, it crashed first time I
tried to display the FolderBrowserDialog. I ran the tests
right after rebooting. To run the test, start the program,
and press Ctrl-S. The times it did not immediately crash,
if I kept bringing up the FolderBrowserDialog, it crashed
pretty soon. OpenFileDialog (included in test program)
does not crash on Windows 2000. FolderBrowserDialog
has not crashed on Windows XP computer.

When FolderBrowserDialog crashes, it's immediately after it
displays the dialog. The dialog appears normal.

An error message window appears - 'The instruction at
"address" referenced memory at "address". The memory
could not be "read". The two addresses are always the same.
After closing error message window, a second error message
window appears - 'program has generated errors and will be
closed by Windows. You will need to restart the program.
An error log is being created.' The log file is a huge
binary file. No exception gets written to the console.

It would surprise me if FolderBrowserDialog crashed Windows
2000, and nobody reported it before. However, I have no way
of knowing at this point. The Windows 2000 computer I tested
on is pretty stable. Sometimes, Windows Explorer does crash
on the computer, but it's been more than a month.

To help figure this out:

* Has FolderBrowserDialog crashing been reported before,
either on Microsoft site or elsewhere? I could not find.

* Can someone run same test on their Windows 2000 multiple
times, and post whether it crashes or not?

* Has anyone used FolderBrowserDialog in a desktop .NET
application, and tested it to be stable with Windows 2000?

Many thanks,
Daniel Goldman

Nov 17 '05 #5

P: n/a
You use a Environment.SpecialFolder constant to set the
root directory. I am pretty sure it does not allow you to set
the root from any folder, and not from "C:\" directory

folderBrowserDlg.RootFolder = Environment.SpecialFolder.Personal;

The closest you can get to what you want is use SelectedPath

*****

Did you try running the test program on Windows 2000?

In response to Brendan's previous question, I just installed
..NET to a Windows 98 computer. The FolderBrowserDialog
test program ran fine on the Windows 98 PC. No crashes.
That is reassuring, but I would still greatly appreciate it if
others could test on Windows 2000. Daniel Goldman

Nov 17 '05 #6

P: n/a
yes! thanks.

<hh******@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
You use a Environment.SpecialFolder constant to set the
root directory. I am pretty sure it does not allow you to set
the root from any folder, and not from "C:\" directory

folderBrowserDlg.RootFolder = Environment.SpecialFolder.Personal;

The closest you can get to what you want is use SelectedPath

*****

Did you try running the test program on Windows 2000?

In response to Brendan's previous question, I just installed
.NET to a Windows 98 computer. The FolderBrowserDialog
test program ran fine on the Windows 98 PC. No crashes.
That is reassuring, but I would still greatly appreciate it if
others could test on Windows 2000. Daniel Goldman

Nov 17 '05 #7

P: n/a
If yes means you repeatedly ran the test program,
did it crash? Thanks, Daniel Goldman

Nov 17 '05 #8

P: n/a
I have started it on XP Pro and 2k (russian). It works completely well.

Earlier used their code:

====================================
// FolderBrowser.cs :
// Written by Pardesi Services, LLC
// Version 1.0.0
====================================

Here it is bad. :)

<hh******@yahoo.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
If yes means you repeatedly ran the test program,
did it crash? Thanks, Daniel Goldman

Nov 17 '05 #9

P: n/a
I am suspecting it is something with my Windows 2000. Yesterday, my
Netscape Mail client crashed with same error message. And, as I said
previously, Windows Explorer also occasionally crashes with same error.

I would still appreciate someone else running the test program on
Windows
2000. It would be reassuring to hear FolderBrowserDialog does not crash
on other's Windows 2000 computers.

Thanks,
Daniel Goldman

PS - I have applied all Windows 2000 updates.

Nov 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.