473,394 Members | 1,721 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,394 software developers and data experts.

Debugging Challenge - no source available

Hello all,

I am working on an application which uses quite a few bitmaps as skins for
custom controls.

I am getting a very difficult bug to track - my application performs quite a
few bitmap operations which use a timer to help time-slice so the UI remains
responsive. At one point, I am setting a flag to indicate to the timer that a
particular control needs to have its background refreshed. This is placed
into a list for future handling. This completes fine. Debugging in the timer
also doesn't reveal any problems, although it gets rather difficult to follow
the execution thread.

At any rate, at some, not particularly repeatable point, I press F10 and
control returns to .net/Windows and I get the error:

"A first chance exception of type 'System.ArgumentException' occurred in
system.drawing.dll Additional information: Invalid parameter used."

The problem is that I don't have any clue as to where the error is occurring
- the debugger stops at the Application.Run() line, there's no call stack, no
objects I can evaluate, I'm kinda stuck.

If I turn off exception debugging (i.e. set "When the exception is thrown"
radio-button to "Continue"), then the error changes to:

"An unhandled exception of type 'System.ArgumentException' occurred in
system.windows.forms.dll Additional information: Invalid parameter used."

In both cases, the debugger catches execution at the same point, just before
shutting the program down.

I'm looking for any pointers on steps I can take to at least cause execution
to pause at some useful point.

Thanks,
Markus Szillat
Jul 21 '05 #1
2 4921
My guess might be that some judiciously placed debug.writeline statements
might be in order to at least help you collect some runtime data as to where
you were in the code at the time of the crash.

"markusszil" <ma********@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
Hello all,

I am working on an application which uses quite a few bitmaps as skins for
custom controls.

I am getting a very difficult bug to track - my application performs quite a few bitmap operations which use a timer to help time-slice so the UI remains responsive. At one point, I am setting a flag to indicate to the timer that a particular control needs to have its background refreshed. This is placed
into a list for future handling. This completes fine. Debugging in the timer also doesn't reveal any problems, although it gets rather difficult to follow the execution thread.

At any rate, at some, not particularly repeatable point, I press F10 and
control returns to .net/Windows and I get the error:

"A first chance exception of type 'System.ArgumentException' occurred in
system.drawing.dll Additional information: Invalid parameter used."

The problem is that I don't have any clue as to where the error is occurring - the debugger stops at the Application.Run() line, there's no call stack, no objects I can evaluate, I'm kinda stuck.

If I turn off exception debugging (i.e. set "When the exception is thrown"
radio-button to "Continue"), then the error changes to:

"An unhandled exception of type 'System.ArgumentException' occurred in
system.windows.forms.dll Additional information: Invalid parameter used."
In both cases, the debugger catches execution at the same point, just before shutting the program down.

I'm looking for any pointers on steps I can take to at least cause execution to pause at some useful point.

Thanks,
Markus Szillat

Jul 21 '05 #2
Thanks for the tip.

I altered the program start from:

Application.Run(new MyClass());

to:

MyClass a=new MyClass();
Application.Run(a);

And when it crashes I now have an object (a) to inspect. I also added a few
lines to tell if a particular routine (e.g. timer) was executing during the
crash, but it appears that my code is not executing at the time - I suspect
problems inside .net's painting algorithms. I suspect it may have to do with
transparent backgrounds - I previously noticed some bizarre behavior when I
tried to set a control's background to a transparent bitmap (the transparent
region is filled with screen garbage). There's a note in the help file that
transparent images are not supported. I suspect that at times that might
cause some type of memory fault causing .net to crash, but it's hard to know
for sure. I've decided to derive my own control from the label control I'm
having the problem with and override its OnPaint method with nothing, then
generate my own method to cache the label's image over my bitmap and have my
bitmap-based control just render the cached bitmap. Hopefully that will fix
the problem.

Thanks for the tip,
Markus
"Ray Cassick (Home)" wrote:
My guess might be that some judiciously placed debug.writeline statements
might be in order to at least help you collect some runtime data as to where
you were in the code at the time of the crash.

"markusszil" <ma********@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
Hello all,

I am working on an application which uses quite a few bitmaps as skins for
custom controls.

I am getting a very difficult bug to track - my application performs quite

a
few bitmap operations which use a timer to help time-slice so the UI

remains
responsive. At one point, I am setting a flag to indicate to the timer

that a
particular control needs to have its background refreshed. This is placed
into a list for future handling. This completes fine. Debugging in the

timer
also doesn't reveal any problems, although it gets rather difficult to

follow
the execution thread.

At any rate, at some, not particularly repeatable point, I press F10 and
control returns to .net/Windows and I get the error:

"A first chance exception of type 'System.ArgumentException' occurred in
system.drawing.dll Additional information: Invalid parameter used."

The problem is that I don't have any clue as to where the error is

occurring
- the debugger stops at the Application.Run() line, there's no call stack,

no
objects I can evaluate, I'm kinda stuck.

If I turn off exception debugging (i.e. set "When the exception is thrown"
radio-button to "Continue"), then the error changes to:

"An unhandled exception of type 'System.ArgumentException' occurred in
system.windows.forms.dll Additional information: Invalid parameter

used."

In both cases, the debugger catches execution at the same point, just

before
shutting the program down.

I'm looking for any pointers on steps I can take to at least cause

execution
to pause at some useful point.

Thanks,
Markus Szillat


Jul 21 '05 #3

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

Similar topics

16
by: Java script Dude | last post by:
To all Mozilla JS Guru's (IE dudes welcome), I have spent the last three years developing complex DHTML applications that must work in IE 5.5sp2+ but I use Mozilla 1.3+** to do all my...
6
by: Dmitri Shvetsov | last post by:
Hi All, Did somebody see the situation when the VS refuses to debug the Web Service at all? I can't catch why, the initially created Web Service can be debugged very easy but after some changes...
7
by: Advocated | last post by:
Hi there, just wondering if anyone uses visual studio 6? Im having real problems, just with debugging, i could either do with a really good tutorial, if anyone knows of one, but the main thing...
0
by: Harald Hoyer | last post by:
My application has an exe and some DLLs. During debugging only debug information of the current binary is available. For example: ============DLL: ...
2
by: markusszil | last post by:
Hello all, I am working on an application which uses quite a few bitmaps as skins for custom controls. I am getting a very difficult bug to track - my application performs quite a few bitmap...
5
by: Egbert Nierop \(MVP for IIS\) | last post by:
hi, I have a testing win2003 machine, where I debug inside a MMC process using a DebugBreak() statement. But only the first time, source code was shown, after that, I only get to see...
4
by: Jason Teagle | last post by:
I'm not sure which is the correct group to post this to, if either, so apologies for the crosspost and if it's OT. I have a Visual Studio.NET 2002-compiled solution that originated at work. At...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.