472,986 Members | 3,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

FolderBrowserDialog crashes on Windows 2000

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
9 2378
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
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
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
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
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
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
If yes means you repeatedly ran the test program,
did it crash? Thanks, Daniel Goldman

Nov 17 '05 #8
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: R A | last post by:
Hi, I use FolderBrowserDialog in my c# windows forms project. It was working with no issues, but right now the dialog shows but I can't see any directories selection. I can see the buttons at...
7
by: seash | last post by:
In VS200 Using the System.Windows.Forms.FolderBrowserDialog control The New Folder button is always available Set the ShowNewFolderButton property to false in code prior to cal ShowDialo...
0
by: Tommy Clark | last post by:
I am using Microsoft Development Environment 2003 Version 7.1.3088 and .NET Framework 1.1 Version 1.1.4322 SP1. I have an MFC application that we have ported to .NET and have added the...
6
by: John Krueger | last post by:
The FolderBrowserDialog control in my toolbox has vanished! I did not delibratly remove it and it is just not there anymore. I tried to add it back to the toolbox but there isn't even a .NET...
5
by: Robin Tucker | last post by:
I've noticed that my program executable remains in the process list if at any stage my program has shown a FolderBrowserDialog. I am calling .Dipose on the dialog after use. This does not happen...
12
by: JohnR | last post by:
I have narrowed a problem down to a simple example. A form with two buttons. One EXIT and one FBD. The exit button does an "END" to end the application. The FBD button does a...
1
by: powersof2 | last post by:
Hello, I need some help with SQL Server 2000 SP4. I've been using the developer product for a few years now on my PC with very few problems. Today when I try to start up Enterprise Manager, it...
0
by: mohit | last post by:
Hello, I am running my windows application on a 64 bit machine with MS .NET Framework 2.0 (x64). When using the FolderBrowserDialog an unhandled exception was coming time and again. After...
3
by: Michael Howes | last post by:
I need a folder selection tree on my windows form. I don't see a way to add the FolderBrowswerDialog as a Control and add it to my form's controls collection. Is there a way to accomplish this...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.