Alan Robbins

Greetings

In routine "B" called by routine "A"... In routine A my object looks great. In routine B the method table for my object has vanished! Every accessor/mutator returns this error.

My question is what would cause the method table to be dumped like this A native frame is not on the call stack when this happens.

Regards




Re: Visual C# General base {System.SystemException}: {"The pointer for this method was null."}

TilakGopi

Hi,

Is your object private member or passed to function A ,from there to function B

Are you sure , no where you are assinging any value to this object.

If you are assigning any value(a function's return value or a property or a variable), watching where it is getting assigned null ,during debugging will pull you out of this problem.

Thanks,

Ch.T.Gopi Kumar.






Re: Visual C# General base {System.SystemException}: {"The pointer for this method was null."}

Alan Robbins

Tilak

Thanks for responding. Now here's the funny thing...

Routine A is iterating over a generic collection, calling Routine B.

Routine B invokes a Find predicate on a different collection of objects of the same type.

As soon as the Find Predicate comes back, the method vtable on the passed object is lost.

However, if I replace the find predicate with an "old-fashioned" iterate over the collection and break when you find it...

No problem. Go figure. I'm not mixing enumerators, or changing the collection in any way. I believe this to be a bug in predicates somewhere, but I'm sure it would be all but impossible to replicate outside of the 300,000 lines of code where it occurs :-)

Regards

Alan






Re: Visual C# General base {System.SystemException}: {"The pointer for this method was null."}

TilakGopi

Hi,

It's been bit difficult to understand what you explained ,as i am novice with the predicates and iterators.Anyways thanks for explanation.Good Luck.

Best Regards,

Ch.T.Gopi Kumar.






Re: Visual C# General base {System.SystemException}: {"The pointer for this method was null."}

Alan Robbins

Kumar

Predicates are very powerful, you should look into them!

Iterators:

When you say for each (item x in collection y)

This is a shorthand way of saying:

IEnumerator X = Y.GetEnumerator();

while (X.MoveNext())

{

}

X is an enumerator that iterates over collection Y.

What a predicate does is execute a predefined action against all the elements of the collection with one call. So if I say: Y.ForEach(FunctionName) the framework executes the function against each element. Check it out, it's almost as neat as generic collections.

Regards

Alan






Re: Visual C# General base {System.SystemException}: {"The pointer for this method was null."}

TilakGopi

Thanks Alan,

Now i understood bit about predicates and iterators and using the predicates.Yes,i'll learn using them.Thanks once again.

Best Regards,

Ch.T.Gopi Kumar.