[.Net 1.1] Strange error

A

Adam Klobukowski

Hello

I have a scrollable System.Windows.Forms.Panel, and I add/remove
controls (ListView only) to/from it programatically.

Sometimes, probaly when redrawing the panel while adding/removing
controls or scrolling the panel i get an infinite loop of messageboxes
saying "invalid parameter used" but no exceprion is thrown. It happens
randomly, I cannot reproduce steps to achieve it.

I do not do any painting operations on it, I handle only few events
related to mouse and SelectedItem in listview.

Wha co I do to avoid it?
 
M

Mehdi

I have a scrollable System.Windows.Forms.Panel, and I add/remove
controls (ListView only) to/from it programatically.

Sometimes, probaly when redrawing the panel while adding/removing
controls or scrolling the panel i get an infinite loop of messageboxes
saying "invalid parameter used" but no exceprion is thrown. It happens
randomly, I cannot reproduce steps to achieve it.

None of the methods of the .NET Framework classes display any message box
unless you explicitely ask them to. So you must have some code somewhere
that catches some (or all) of the exceptions and displays a message box
with the exception message instead of letting the exception bubble up. Find
this code and remove that so that you can trace where the problem comes
from.

Or are you talking about Visual Studio's unhandled exception dialog box
that pops up automatically whenever an unhandled exception occurs in your
code? In this case, run your application in Debug mode and when this dialog
box pops up, click the Break button to break into your code. From there,
you'll be able to examine your stack trace and the state of your objects to
determine why the exception has been thrown.

In any case, you can always configure Visual Studio to break into your code
whenever an exception (handled or not) is thrown by going to: Debug menu ->
Exceptions -> Common Language Runtime Exceptions -> When an exception is
thrown: break into the debugger.
 
A

Adam Klobukowski

Mehdi napisał(a):
None of the methods of the .NET Framework classes display any message box
unless you explicitely ask them to. So you must have some code somewhere
that catches some (or all) of the exceptions and displays a message box
with the exception message instead of letting the exception bubble up. Find
this code and remove that so that you can trace where the problem comes
from.

Or are you talking about Visual Studio's unhandled exception dialog box
that pops up automatically whenever an unhandled exception occurs in your
code? In this case, run your application in Debug mode and when this dialog
box pops up, click the Break button to break into your code. From there,
you'll be able to examine your stack trace and the state of your objects to
determine why the exception has been thrown.

In any case, you can always configure Visual Studio to break into your code
whenever an exception (handled or not) is thrown by going to: Debug menu ->
Exceptions -> Common Language Runtime Exceptions -> When an exception is
thrown: break into the debugger.

The problem is I'm 100% sure that not my code is displaying it - the
strange thing in it is that text in message box is bold. I do not
remember any standart .NET messagebox being able to output bold text.
Moreover, there are 3 MessageBox.Show calls around that code, but all of
them display fixed text.

I know I can catch any exception, but the problem is that it happens
really randomly and when I try to trigger it it just does not happen.

--
Semper Fidelis


Adam Klobukowski
(e-mail address removed)
 

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