Re: Object reference not set to an instance of an object
From: Marcos Stefanakopolus (taruntius_at_hotmail.com)
Date: 03/09/05
- Next message: Steve Teeples: "Re: Loading debug information"
- Previous message: Maarten: "Re: communicate multiple form"
- In reply to: Steve Teeples: "Object reference not set to an instance of an object"
- Next in thread: Brian Brown: "RE: Object reference not set to an instance of an object"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Mar 2005 11:04:06 -0800
The error is almost certainly in your code, not in any of those DLLs. I
would bet money that somewhere you have a variable that is declared to be of
some reference type, but you never assigned it to a "new" object of that
type. E.G:
ArrayList foo;
foo.Add("hi there");
This will generate that same error, whereas:
ArrayList foo;
foo = new ArrayList();
foo.Add("hi there");
will work fine. I most often trip myself up this way when I've got a
non-static field in a class that is of some reference type, but I forget to
initialize it in the constructor. That's about the only situation I ever
run into where it even makes sense to separate the declaration of the
variable from the initialization anyway. In your case, if you really think
the exception is originating from within one of those DLLs, then you're
probably passing an uninitialized object into some library routine, and are
triggering the exception that way.
"Steve Teeples" <SteveTeeples@discussions.microsoft.com> wrote in message
news:27D10CF1-34BF-4875-8407-102DDEDFB119@microsoft.com...
>I keep getting the error "Object reference not set to an instance of an
> object." The unhandled exception is a System.NullReferenceException. It
> is
> occurring in an "unknown module". How do I load within the IDE debug
> symbols
> for system.dll, drawing.dll, forms.dll to trace this error?
> --
> Steve
- Next message: Steve Teeples: "Re: Loading debug information"
- Previous message: Maarten: "Re: communicate multiple form"
- In reply to: Steve Teeples: "Object reference not set to an instance of an object"
- Next in thread: Brian Brown: "RE: Object reference not set to an instance of an object"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|