Original Post
I am trying to convert a c# program over to managed c++. Problem is I'm having some difficulty converting it over. I'm still relatively new to .NET so this is a good learning experience for me. One of the functions in a class called Attributelist looks like this: the Attributelist is a class that inheities from another class called Attribute. How do I convert this function over. As you can see, it uses the 'base' keyword from C#.. Is there an equivelent keyword in MC++ that I need to use? Another line of code giving me problems is this: I get this: error C2107: illegal index, indirection not allowed Here is another: Here are the errors I get: error C2845: '[' : cannot perform pointer arithmetic on __gc pointer 'HTML::AttributeList __gc *const ' error C2227: left of '->Clone' must point to class/struct/union Here is one last one: This one I don't know what to do with. It is part of the AttributeList class were attribute is one entity of the list. Thanks for any help anyone can provide.
public Attributelist():base("","")
{
m_list = new ArrayList();
}
// C# version
public void Set(string name,string value)
{
...
Attribute a = this[name];
...
}
// MC++ version
public void Set(String* name, String* value)
{
...
Attribute* a = this[name];
...
}
// C# version
for ( int i=0;i<m_list.Count;i++ )
rtn.Add( (Attribute)this.Clone() );
// MC++ version
for (int i=0; i<m_list->Count; i++)
rtn->Add(static_cast<AttributeHTML*>(this->Clone()));
// C# version
public Attribute this[int index]
{
...
}