views:

30

answers:

1

Hi,

I have a main program written in C# which creates and uses objects written in C++.

One of these objects, MODULE, uses a Behavior class (C++), which contains a lot of parameters, initialized by an interface managed by the C# main.

One of these parameters is a system::Collection::Generic < AnotherObject>, let's call it LIST. The behavior object is initialized well, LIST contains an element which is correct.

But when I create a MODULE and call its method BuildModule(BEHAVIOR), at the line of the call, the LIST seems to be damaged. I got this in the locals :

Capacity error: an exception of type: System::TypeLoadException^ occurred>
Count error: an exception of type: System::TypeLoadException^ occurred>
Item cannot view indexed property>
System.Collections.Generic.ICollection.IsReadOnly error: an exception of type: System::TypeLoadException^ occurred>
System.Collections.ICollection.IsSynchronized error: an exception of type: System::TypeLoadException^ occurred>
System.Collections.ICollection.SyncRoot error: an exception of type: System::TypeLoadException^ occurred>
System.Collections.IList.IsFixedSize error: an exception of type: System::TypeLoadException^ occurred>
System.Collections.IList.IsReadOnly error: an exception of type: System::TypeLoadException^ occurred> System.Collections.IList.Item cannot view indexed property>

This appears not to be loaded, but I don't know - the other objects are loaded, even more complex ones.

If anyone has a clue, I would be grateful.

A: 

You are showing exceptions that the debugger suffers when it tries to display the list instance. It isn't going help either you or us to diagnose the problem, you'll need to take a look at the exception that the code generates. If that doesn't help, post what you see in the exception's message and stack trace properties. The InnerException is most important, in case it isn't null.

This kind of mishap is usually caused by heap corruption btw.

Hans Passant