Search code examples
c++-clicstring

Equivalent type for CStringList


What should be the equivalent type:

CStringList

in C++/CLI?

I tried to use:

System::Collections::Generic::List<System::String ^>

but I am unable to convert it to CStringList for passing to the function being wrapped and vice versa. The function to be wrapped is:

void getEqui(CStringList& list);

Solution

  • List<String^>^ is the logical equivilent to CStringList, as you noted. However, there is no direct conversion, you'll need to iterate over the List, create CStrings, and insert them into the CStringList.