Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > NullReferenceException: Object reference not set to an instance of an object

Reply
Thread Tools

NullReferenceException: Object reference not set to an instance of an object

 
 
Rob Van Zant
Guest
Posts: n/a
 
      11-10-2003
I have a 3rd party library (.lib) file with two header files which I have
wrapped in a c++ .net dll. I am trying to use that dll in an asp.net
project but I get the error "Object reference not set to an instance of an
object."

I added the dll to my project as a .net reference and I can see all exposed
functions in the object browser. The function call(s) that causes the error
is

sweep_output_t* sweep_output = new sweep_output_t[sizof_series];
[sweep_output=(sweep_output_t *)malloc(sizeof(sweep_output_t)*sizof_series);
gives the same error.]

sweep_output_t is a structure defined in one of the third party header files
and sizof_series is an integer that in my test is set to 3. I don't know if
it matters but I can not see sweep_output_t in the object browser but I can
see sweep_output_s.

typedef struct sweep_output_s
{
double f;
double il;
double rl;
double ph;
double gd;
} sweep_output_t;

I checked to make sure my dll is working correctly by changing the project
to build an executable and adding a windows form and the lib file and
wrapper code work great.

The stack trace reveals "new(UInt32 ) +0" [or "malloc(UInt32 ) +0" for
malloc alternative].

Any help in resolving my problem will be greatly appreciated.

Thanks,
Rob


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Object reference not set to an instance of an object" Weird thing happens with reference a link nguyentrongkha@gmail.com ASP .Net 1 09-20-2007 09:46 PM
Error:Object reference not set to an instance of an object. Suresh Kojhani ASP .Net 1 07-29-2004 12:10 PM
Error !Object reference not set to an instance of an object. !!! Help Parthiv Joshi ASP .Net 2 07-02-2004 10:28 AM
Object reference not set to an instance of an object. yysiow ASP .Net 1 07-12-2003 03:30 PM
Object reference not set to an instance of an object. Chris Fink ASP .Net 2 07-03-2003 06:48 PM



Advertisments