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

NullReferenceException in WmPaint

Hello

First, I am sorry about my cross-posting, but my problem, although happened
to windows forms, is about fixing exceptions not thrown by code. So can be
applied to C# in general.

My customer reported getting this exception (details below) in the his
application. The exception was thrown in the Control.WmPaint method, which
is in the System.Windows.Forms assembly, and none of the methods in the
stack trace is in my application code. All are in the System.Windows.Forms
assembly.
The application is running on Windows 2000 professional (German) (SP4 with
all windows updates installed) and .NET Framework 1.1 (German)

************** Ausnametext **************
System.NullReferenceException: Der Objektverweis wurde nicht auf eine
Objektinstanz festgelegt.
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

The first thing that I thought of, that may be WmPaint catches an exception
thrown by my code, and rethrows the exception, but a look at the disassembly
of WmPaint told me that WmPaint doesn't have any catch or throw statements.

This bug occurred only once, and my customer and I were unable to reproduce
it again. The question is how can I track and fix a problem like this when
the exception is not thrown by my code, or a method called by my code?
Any help is appreciated.

Thanks a lot in advance,
Best regards
Sherif ElMetainy


Nov 15 '05 #1
0 887

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

Similar topics

3
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in...
5
by: Fabio Papa | last post by:
Hi, I am fairly new to programming and and even newer to dotnet. I appoligise in advance if this is a dumb questions, and I would appreciate if you could answer it anyways. :) I am writing a...
5
by: TT (Tom Tempelaere) | last post by:
Hi, Once in a while my application throws an NullReferenceException at startup, however it appears to be occurring in an unknown module. If I debug it and ask to 'break', then there is no source...
2
by: Enrico Pangan | last post by:
I'm trying to call some functions in a C++ Dll, "Library.dll" from C#. Some functions work but some return the NullReferenceException. I have here the source code for the C++ version and for the...
2
by: Raed Sawalha | last post by:
i have a windows form(Main) with listview, when click an item in listview i open other window form (Sub) which generate the selected item from parent window in as treeview items when click any item...
1
by: msnews.microsoft.com | last post by:
I'm trying to fill an array of objects but when I add the first object I get a NullReferenceException. ----------------------------------------------------------------------------...
6
by: William Mild | last post by:
I must be getting brain fried. I can't see the error. Create a new web form with the following code begind: Public Class test Inherits System.Web.UI.Page Public Class ReportCardData ...
9
by: Xero | last post by:
could anybody describes a scenario where this error will occur? i have visited the page about the NullReferenceException in msdn library but i still have no idea what it is about. thanks. ...
3
by: Sagar | last post by:
Hi. I am working on a project to migrate a web application from 1.1 to 2.0 Within in the DAL of the application, there is a call to below function that builds a command object for later use. ...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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:
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
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.