Refer to this table:
http://connect.microsoft.com/VisualStudio/feedback/details/100163/c-cli-access-modifiers-are-not-consistent[
^].
The difference between public and internal is this: public is visible from outside of declaring assembly (by any referencing assembly as well), internal visibility is limited by declaring assembly.
Your problem is quite different: error message c3145 reads: "'object' : global or static variable may not have managed type 'type'".
Why didn't you post the error message in first place? See
http://msdn.microsoft.com/en-us/library/by40z94e.aspx[
^].
You did not even show the line of code causing error message. Is it the first line in your code? It can be declared only inside
ref
class or structure. Move it into you class. See the help on error message again (above).
Right now, your code does not make sense though, because you're putting data nowhere, into the collection. Also, don't use
ArrayList
, use
System::Collections::Generic::List
. Non-generic collection classes are not needed anymore, after generic is introduced. Non-generic collection classes require type casting in members, who need it?
—SA