473,378 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 2398
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.