NullReferenceException in MessageLoop

J

Jack Wright

Dear All,
I frequently get a NullReferenceException in my application. The
workflow in this case is that it happens only the first time when I
drop-down a combo box and select a value...how do I track this error
and find what is null in the messageloop...will adding IMessageFilter
and using PreFilterMessage help...

Please help...

Exception Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: System.Windows.Forms
StackTrace: at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32
reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.DoEvents()

TALIA

Many Regards
Jack
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Jack,
Can you post compilable sample that demosntrates the problem? Without it it
is really hard to tell.
 

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

Top