B
Bob Altman
Hi all,
In C++/CLI (VS 2005) I have a C++ module compiled with /clr that contains a
module-level gcroot variable:
static gcroot<MyList^> m_myList = gcnew MyList;
In the above statement, MyList is a managed class that inherits from
Generic::List. I want to iterate through m_myList like this:
for each (MyItem^ myItem in m_myList) {
[do something with myItem]
}
but I get error c3285: for each statement cannot operate on variables of type
'gcroot<T>'
So, how do I iterate through a List that's stored in a gcroot?
TIA - Bob
In C++/CLI (VS 2005) I have a C++ module compiled with /clr that contains a
module-level gcroot variable:
static gcroot<MyList^> m_myList = gcnew MyList;
In the above statement, MyList is a managed class that inherits from
Generic::List. I want to iterate through m_myList like this:
for each (MyItem^ myItem in m_myList) {
[do something with myItem]
}
but I get error c3285: for each statement cannot operate on variables of type
'gcroot<T>'
So, how do I iterate through a List that's stored in a gcroot?
TIA - Bob