darwen
April 23rd, 2004, 10:56 PM
I notice that classes such as System::Collections::ArrayList have default properties such as ::Item which can be used in the following way in C# -
ArrayList asArray = new ArrayList();
asArray.Add("Hello");
String sString = asArray[0];
When implementing a .NET assembly in C++ is there any way of defining default properties in this way. The only way I've found which is picked up by C# is to use get_ and set_ functions.
So, I want to be able to (for example)
// in C++ assembly
class StringArray : public ArrayList;
// in C#, what I want
StringArray asStrings = new StringArray();
String sString = asStrings[0];
// the only way I've found of doing it :
String sString = asStrings.get_String(0);
Many thanks,
Darwen.
ArrayList asArray = new ArrayList();
asArray.Add("Hello");
String sString = asArray[0];
When implementing a .NET assembly in C++ is there any way of defining default properties in this way. The only way I've found which is picked up by C# is to use get_ and set_ functions.
So, I want to be able to (for example)
// in C++ assembly
class StringArray : public ArrayList;
// in C#, what I want
StringArray asStrings = new StringArray();
String sString = asStrings[0];
// the only way I've found of doing it :
String sString = asStrings.get_String(0);
Many thanks,
Darwen.