a StackOverflowException which doesn't make sense

G

Guest

Hello
I have encountered a strange crashing of an app I'm working on
When I was trying to isolate the cause of the exception I mad
following discovery
When I create a new project: Windows Application in C#, add a butto
on the form and write the following lines into the Click even
handler
private void button1_Click(object sender, System.EventArgs e

SaveFileDialog dlg = new SaveFileDialog()
dlg.ShowDialog()

the application will crash when I close the save file dialog. I
crashes on the line with the closing bracke
of the Main() function
As far as I know the problem occurs only on machines with winXP wit
latest updates and MS Visual Studio .NET 2003 installed. The proble
doesn't occur on Win2k with MS Visual Studio .NET nor on WinX
without MS Visual Studio .NET
Did anybody encountered similar problem

Regards
Jakub Gajd
 
G

Guest

Hi Jakub,
Hello.
I have encountered a strange crashing of an app I'm working on.
When I was trying to isolate the cause of the exception I made
following discovery:
When I create a new project: Windows Application in C#, add a button
on the form and write the following lines into the Click event
handler:

I don't find a bug in your code.

Try to iterate this changes in DEBUG mode:

private void button1_Click(object sender, System.EventArgs e)
{
SaveFileDialog dlg = new SaveFileDialog();
DialogResult result=dlg.ShowDialog(this);
// "this" if parent of your button1 is Form
result=result; // only check that "ShowDialog" returns value
}
the application will crash when I close the save file dialog. It
crashes on the line with the closing bracket
of the Main() function.
As far as I know the problem occurs only on machines with winXP with
latest updates and MS Visual Studio .NET 2003 installed. The problem
doesn't occur on Win2k with MS Visual Studio .NET nor on WinXP
without MS Visual Studio .NET.
Did anybody encountered similar problem?

and you can catch your Application.Run(...) in try...catch
to look in exception's StackTrace.

"StackOverflowException" occurs usually on "event race"
(event A is trigger for event B, and B is trigger of event A)
or on "base" to "this" replacement error (in overriding)


Regards

Marcin
 
C

codymanix

I have encountered a strange crashing of an app I'm working on.
When I was trying to isolate the cause of the exception I made
following discovery:
When I create a new project: Windows Application in C#, add a button
on the form and write the following lines into the Click event
handler:
private void button1_Click(object sender, System.EventArgs e)
{
SaveFileDialog dlg = new SaveFileDialog();
dlg.ShowDialog();
}
the application will crash when I close the save file dialog. It
crashes on the line with the closing bracket
of the Main() function.
As far as I know the problem occurs only on machines with winXP with
latest updates and MS Visual Studio .NET 2003 installed. The problem
doesn't occur on Win2k with MS Visual Studio .NET nor on WinXP
without MS Visual Studio .NET.
Did anybody encountered similar problem?


maybe the savefiledialaog is missing a filterstring or something. normally
it should work anyway but on windowsXP you never know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top