Thread help

  • Thread starter Thread starter trialproduct2004
  • Start date Start date
T

trialproduct2004

Hi all
i am having error is multi threaded application.
I have function in which i am opening form and starting thread.
But while doing this i am getting following error.
This exception is getting catched in main.
Does anyone know what is nativewindow.
Error:-
System.NullReferenceException: Object reference not set to an instance
of an object.
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.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(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
Please help me.
Thanks in advance.
 
Are you trying to start a new thread in the WndProc Sub?

What are the messages you are trying to process in WndProc?

The object not set error is because you need to declare it as 'New', which
you haven't done.

Please let me/us know
 
hi
i have created every object using new operator still if i run
application more than 10 times my application is getting crash.

Is it a memory issue. Because even after allocating memory, after
executing some part of code, object becoming unreference.

Please help me.
 

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

Back
Top