473,326 Members | 2,108 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,326 software developers and data experts.

System.ArgumentNullException

This error occurs erratically at startup. It appears to be all native
code. Does anyone have any idea what the heck could be cauing this?

System.ArgumentNullException: Value cannot be null.
Parameter name: pen
at System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1,
Int32 x2, Int32 y2)
at dh.OnPaint(PaintEventArgs e)
at
System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.OnPrint(PaintEventArg s e)
at System.Windows.Forms.Control.WmPrintClient(Message & m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at dh.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
Mar 24 '08 #1
2 2476
On Mar 24, 9:09*am, Tom C <tom_cla...@asdsoftware.comwrote:
This error occurs erratically at startup. It appears to be all native
code. Does anyone have any idea what the heck could be cauing this?

System.ArgumentNullException: Value cannot be null.
Parameter name: pen
* *at System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1,
Int32 x2, Int32 y2)
* *at dh.OnPaint(PaintEventArgs e)
* *at
System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
* *at System.Windows.Forms.Control.OnPrint(PaintEventArg s e)
* *at System.Windows.Forms.Control.WmPrintClient(Message & m)
* *at System.Windows.Forms.Control.WndProc(Message& m)
* *at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
* *at dh.WndProc(Message& m)
* *at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
* *at
System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
* *at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
I have seen an ArgumentNullException generated inside the control
painting routines when threading is used incorrectly with windows
applications. What happens is another thread modifies a control which
causes it to enter a half-baked state the moment it simultantenously
receives say the WM_PAINT message. Remember, only the UI thread can
ever access a windows control or form. I'm not saying that's what's
happening here, but it is one thing to consider.
Mar 24 '08 #2
On Mar 24, 10:04*am, Brian Gideon <briangid...@yahoo.comwrote:
On Mar 24, 9:09*am, Tom C <tom_cla...@asdsoftware.comwrote:


This error occurs erratically at startup. It appears to be all native
code. Does anyone have any idea what the heck could be cauing this?
System.ArgumentNullException: Value cannot be null.
Parameter name: pen
* *at System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1,
Int32 x2, Int32 y2)
* *at dh.OnPaint(PaintEventArgs e)
* *at
System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
* *at System.Windows.Forms.Control.OnPrint(PaintEventArg s e)
* *at System.Windows.Forms.Control.WmPrintClient(Message & m)
* *at System.Windows.Forms.Control.WndProc(Message& m)
* *at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
* *at dh.WndProc(Message& m)
* *at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
* *at
System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
* *at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

I have seen an ArgumentNullException generated inside the control
painting routines when threading is used incorrectly with windows
applications. *What happens is another thread modifies a control which
causes it to enter a half-baked state the moment it simultantenously
receives say the WM_PAINT message. *Remember, only the UI thread can
ever access a windows control or form. *I'm not saying that's what's
happening here, but it is one thing to consider.- Hide quoted text -

- Show quoted text -
Thanks for the input Brian. We really use threads rather sparingly so
we took a look and really don't SEE anything readily obvious. Does
anyone have any ides on how we might be able to capture more
information about the error when it occurs as we seem to be at a
disadvantage as it appears to all be native code.
Mar 24 '08 #3

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

Similar topics

3
by: MJB | last post by:
I'm getting an IStream back from function xmlHttp.responsestream. I would like to convert this to a System.IO.Stream in order to work with it in my application. Has anyone encountered this and...
3
by: Bisbal | last post by:
Hi, I'd like to know if it is possible to create a form type from a string. My case: I have a DataTable with forms names (i.e frm_001_UserInfo.cs), and I'd like to create an instance of that...
0
by: Joachim | last post by:
When trying to connect clientSocket.Connect(new IPEndPoint(new IPAddress(ipOctets), port)); I get a System.ArgumentException (not a ArgumentNullException) saying "address". What is wrong? I...
3
by: davesNotHere | last post by:
Greetings, experts! I'm having a bit of a problem importing some working code from last night into Visual Studio. The code compiles correctly, but when I run the program, it doesn't seem to open...
5
by: hzgt9b | last post by:
I'm building a dataset that writes out a Point type value. Here's the code that I've got: 1 Dim dsContent As DataSet = New DataSet("content") 2 Dim dtAsset As DataTable = New...
1
by: florinake | last post by:
The following error occurs when I want to make a relation between two tables : "System.ArgumentNullException: 'column' argument cannot be null" . The code where appears the exception: ...
2
by: Claire | last post by:
I'm a noob at emailing from code and I need to add email capabilities to my application. The following code completes without exceptions but I'm not receiving any test emails. How do you debug...
0
by: pankajprakash | last post by:
Hi all I am using the Ajax control toolkit and want to the fill the gridview but at the time of rendering it occurs the error "Sys.ArgumentNullException: Value cannot be null. Parameter name:...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.