473,506 Members | 17,000 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does my dialog box create an Exception?



I created a dialog box which runs fine when I call Show() but gives the following unhandled exception when I call
ShowDialog(). It crashes when exiting from the menu item callback that invoked it.
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll

Additional information: External component has thrown an exception.

It gives no clue as to where the problem is. Except maybe disposing of the dialog box.
This is the menu item code that creates the dialog box. It crashes on exiting the routine.

private void miViewAperiodic_Click(object sender, System.EventArgs e)
{
Tools.ColorModel.ColorRange selectedColorRange;

/* !++
* ! Code added here for creating and testing color range picker dialog box
* !-- */

ColorRangePicker colorRangePicker;

colorRangePicker = new ColorRangePicker();

colorRangePicker.FormBorderStyle = FormBorderStyle.FixedDialog;
colorRangePicker.ControlBox = false;
colorRangePicker.MinimizeBox = false;
colorRangePicker.MaximizeBox = false;
// colorRangePicker.Show();
colorRangePicker.ShowDialog();

if (colorRangePicker.DialogResult == DialogResult.OK)
{
selectedColorRange = colorRangePicker.SelectedColorRange.Duplicate();
Invalidate();
}

} /* End of miViewAperiodic_Click(object, System.EventArgs) */


Any suggestions would be welcome.
Thanks,

Steve
Nov 17 '05 #1
1 1432


well, I found the problem. If I get rid of Application.EnableVisualStyles(); in main it works fine.

I'm not sure what the call buys me. I see no difference in how things work.

steve


On Sun, 15 May 2005 00:51:34 -0400, steve bull <bu****@comcast.net> wrote:


I created a dialog box which runs fine when I call Show() but gives the following unhandled exception when I call
ShowDialog(). It crashes when exiting from the menu item callback that invoked it.
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll

Additional information: External component has thrown an exception.

It gives no clue as to where the problem is. Except maybe disposing of the dialog box.
This is the menu item code that creates the dialog box. It crashes on exiting the routine.

private void miViewAperiodic_Click(object sender, System.EventArgs e)
{
Tools.ColorModel.ColorRange selectedColorRange;

/* !++
* ! Code added here for creating and testing color range picker dialog box
* !-- */

ColorRangePicker colorRangePicker;

colorRangePicker = new ColorRangePicker();

colorRangePicker.FormBorderStyle = FormBorderStyle.FixedDialog;
colorRangePicker.ControlBox = false;
colorRangePicker.MinimizeBox = false;
colorRangePicker.MaximizeBox = false;
// colorRangePicker.Show();
colorRangePicker.ShowDialog();

if (colorRangePicker.DialogResult == DialogResult.OK)
{
selectedColorRange = colorRangePicker.SelectedColorRange.Duplicate();
Invalidate();
}

} /* End of miViewAperiodic_Click(object, System.EventArgs) */


Any suggestions would be welcome.
Thanks,

Steve


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2175
by: AMDRIT | last post by:
'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll is generated when I use "My Custom Dialog". Any ideas what I could be doing wrong? Basically, I wanted to...
0
1093
by: Vinny Vinn | last post by:
In the Exceptions Dialog Box under 'If the exception is not handled' i have checked off the 'Continue' option which allows execution to continue If the exception is not handled.when i run my code...
3
1783
by: ATS | last post by:
PRB - UseShellExecute option does not return STD-ERR Please help, I'm using the Process class to start an external process that "may" fail, for all kinds of reasons, but in particular, it may...
6
4046
by: Steve Long | last post by:
Help, I'm running VS.NET 2003 and when I try to start my application, I get the "unhandled exception" dialog instead of the IDE highlighting the offending line of code. The problem appears to be...
4
1736
by: stax | last post by:
Hi, lately a lot users of my application complain it won't even startup, there seems to be a few problems. Here is a screenshot a user made of a error dialog I've never seen before: ...
12
3533
by: Les Caudle | last post by:
I've got a .NET 2.0 app that works quite well on all of my test boxes. However, at the client's site, it crashes with 'has encounted a problem' basic dialog. No useful info. I've yet to see...
1
5854
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi all, I have got my windows app to handled any UI or unhandled exceptions. following is the code static class Program { /// <summary> /// The main entry point for the...
4
2486
by: WP | last post by:
Disclaimer: I'm new at C# so please be gentle. :-) I'm writing a simple card game where two players play against each other through a middle hand they both connect to. In the client (the player) I...
6
4471
by: Scott Gravenhorst | last post by:
Windows XP SP3 My application is set to open a SaveFile dialog when an exit is requested. When I click the app's close button, the save dialog opens, but when I click to change the folder, the...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.