Home All Groups Group Topic Archive Search About
Author
27 Oct 2006 4:31 PM
Darin
Some of our customers get this message, occasionally and randomly. What
does it mean and what can I do to trap it or (better yet) fix it so it
doesn't occur?

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.


************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance
of an object.
   at System.Windows.Forms.WndProc.Invoke(IntPtr hWnd, Int32 msg, IntPtr
wParam, IntPtr lParam)
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WmUpdateUIState(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.ParkingWindow.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)



I know this might not be a lot of information but I don't know where to
start. Since it is random (I haven't ever duplicated it), it must be
something unique to them.



Darin

*** Sent via Developersdex http://www.developersdex.com ***

Author
27 Oct 2006 4:44 PM
Chris
Darin wrote:
Show quoteHide quote
> Some of our customers get this message, occasionally and randomly. What
> does it mean and what can I do to trap it or (better yet) fix it so it
> doesn't occur?
>
> See the end of this message for details on invoking
>
> just-in-time (JIT) debugging instead of this dialog box.
>
>
> ************** Exception Text **************
> System.NullReferenceException: Object reference not set to an instance
> of an object.
>    at System.Windows.Forms.WndProc.Invoke(IntPtr hWnd, Int32 msg, IntPtr
> wParam, IntPtr lParam)
>    at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
> wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
>    at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
>    at System.Windows.Forms.Control.DefWndProc(Message& m)
>    at System.Windows.Forms.Control.WmUpdateUIState(Message& m)
>    at System.Windows.Forms.Control.WndProc(Message& m)
>    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
>    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
>    at System.Windows.Forms.ParkingWindow.WndProc(Message& m)
>    at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
>    at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
>    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
> IntPtr wparam, IntPtr lparam)
>

>
> I know this might not be a lot of information but I don't know where to
> start. Since it is random (I haven't ever duplicated it), it must be
> something unique to them.
>
>
>
> Darin
>
> *** Sent via Developersdex http://www.developersdex.com ***

this error mean the object you are trying to reference is set to
nothing.  So something like this is happening

Dim Obj as Object
Obj = nothing
Obj.ToString() <- Throws error.
Author
27 Oct 2006 4:50 PM
Theo Verweij
It looks like you are invoking a control that doesn't exist anymore.



Darin wrote:
Show quoteHide quote
> Some of our customers get this message, occasionally and randomly. What
> does it mean and what can I do to trap it or (better yet) fix it so it
> doesn't occur?
>
> See the end of this message for details on invoking
>
> just-in-time (JIT) debugging instead of this dialog box.
>
>
> ************** Exception Text **************
> System.NullReferenceException: Object reference not set to an instance
> of an object.
>    at System.Windows.Forms.WndProc.Invoke(IntPtr hWnd, Int32 msg, IntPtr
> wParam, IntPtr lParam)
>    at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
> wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
>    at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
>    at System.Windows.Forms.Control.DefWndProc(Message& m)
>    at System.Windows.Forms.Control.WmUpdateUIState(Message& m)
>    at System.Windows.Forms.Control.WndProc(Message& m)
>    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
>    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
>    at System.Windows.Forms.ParkingWindow.WndProc(Message& m)
>    at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
>    at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
>    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
> IntPtr wparam, IntPtr lparam)
>

>
> I know this might not be a lot of information but I don't know where to
> start. Since it is random (I haven't ever duplicated it), it must be
> something unique to them.
>
>
>
> Darin
>
> *** Sent via Developersdex http://www.developersdex.com ***
Author
27 Oct 2006 6:54 PM
Herfried K. Wagner [MVP]
"Darin" <darin_nospam@nospamever> schrieb:
> Some of our customers get this message, occasionally and randomly. What
> does it mean and what can I do to trap it or (better yet) fix it so it
> doesn't occur?

*   When does the exception occur?

*   Are you using multiple threads?  If you are doing so, are you sure you
    are using invoking techniques to access forms and controls from other
    threads?

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
30 Oct 2006 1:22 AM
Darin
It seems most errors happen in my Processing Occuring window defined as:

Public Class cMyWaitForm
Inherits fLBPleaseWait
Private tText As String

Public Property iisText() As String
     Get
         Return tText
     End Get
     Set(ByVal value As String)
         tText = value
     End Set
End Property

Sub New()
     MyBase.StartPosition = FormStartPosition.CenterScreen
     MyBase.WindowState = FormWindowState.Normal
     If Not IsBlank(tText) Then
         MyBase.lText.Text = "Processing " & Trim(tText) & "Please Wait"
     End If
     MyBase.Show()
     MyBase.Refresh()
     MyBase.Cursor = Cursors.WaitCursor
End Sub

Private Sub cMyWaitForm_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
     MyBase.Cursor = Cursors.Default
End Sub
End Class

I do the following when I need a please wait form:

dim xwait as new cmywaitform
xwait.show

When I am done w/ it, I do:

xwait.close

Now, should I force a xwait.dispose to clear out everything or will the
close do that instantly?

Darin

*** Sent via Developersdex http://www.developersdex.com ***