NullReferenceException Help

  • Thread starter Thread starter Matthew Sajdera
  • Start date Start date
M

Matthew Sajdera

All -

I need some help debugging a Null Reference Exception error I keep getting
when callling a specific method from a COM object reference.

I need help getting started where to look to see what may be causing this
error. Other method calls to this COM object perform normally, but this
specific call returns the following error:

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

Thanks in advance for the help.

- Matt
 
Hi Matt
This is strange since you mentioned that other calls to functions over the
same object work correctly. May be this function return E_Fail HRESULT with
a code that when matched to the .net exception it match the
NullReferenceException. In other words, may be the exception happens inside
the function and is raised back to the caller.
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Yes...

It looks like that is what is happening. The COM component is bombing out
on this one particular call and the error message .Net coughs up is the Null
Exception error for lack of a better message.

Thanks for the help.

- Matt
 
Great
now that you know what is the cause of the exception , you can catch it as
Null reference ( even though it might not be ) and deal with it in the
correct way depending on your com operation.
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

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