Saurabh
Saurabh

Reputation: 1065

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);

Upvotes: 0

Views: 425

Answers (1)

David Yaw
David Yaw

Reputation: 27874

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.

Upvotes: 1

Related Questions