By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,890 Members | 1,248 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,890 IT Pros & Developers. It's quick & easy.

Thread help

P: n/a
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.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& 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(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
Please help me.
Thanks in advance.

Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Nov 21 '05 #2

P: n/a
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.

Nov 21 '05 #3

P: n/a
Can you post code?

trialproduct2...@yahoo.com wrote:
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.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& 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(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
Please help me.
Thanks in advance.


Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.