What do you mean? It works fine for me.... If I have code written in C# I can
decompile it in managed C++ but in order for that to work I need to reference
the McppLanguage DLL.
A little test:
The Iterator design pattern written in C#:
namespace Iterator
{
internal abstract class AbstractCollection
{
// Methods
protected AbstractCollection();
public abstract Iterator.Iterator CreateIterator();
}
internal abstract class AbstractIterator
{
// Methods
protected AbstractIterator();
public abstract Item CurrentItem();
public abstract Item First();
public abstract bool IsDone();
public abstract Item Next();
}
internal class Collection : AbstractCollection
{
// Methods
public Collection();
public override Iterator.Iterator CreateIterator();
// Properties
public int Count { get; }
public object this[int index] { get; set; }
// Fields
private ArrayList items;
}
public class Form1 : Form
{
// Methods
public Form1();
protected override void Dispose(bool disposing);
private void Form1_Load(object sender, EventArgs e);
private void InitializeComponent();
[STAThread]
private static void Main();
// Fields
private Container components;
private TextBox txtIteratorText;
}
internal class Item
{
// Methods
public Item(string name);
// Properties
public string Name { get; }
// Fields
private string name;
}
internal class Iterator : AbstractIterator
{
// Methods
public Iterator(Collection collection);
public override Item CurrentItem();
public override Item First();
public override bool IsDone();
public override Item Next();
// Properties
public int Step { get; set; }
// Fields
private Collection collection;
private int current;
private int step;
}
}
Compiled then decompiled to C++ using Reflector:
namespace Iterator
{
private __gc abstract class AbstractCollection
{
// Methods
protected: AbstractCollection();
public: abstract Iterator::Iterator __gc * CreateIterator();
};
private __gc abstract class AbstractIterator
{
// Methods
protected: AbstractIterator();
public: abstract Iterator::Item __gc * CurrentItem();
public: abstract Iterator::Item __gc * First();
public: abstract System::Boolean IsDone();
public: abstract Iterator::Item __gc * Next();
};
[System::Reflection:

efaultMember(S"Item")]
private __gc class Collection : public Iterator::AbstractCollection
{
// Methods
public: Collection();
public: override Iterator::Iterator __gc * CreateIterator();
// Properties
public: __property System::Int32 get_Count();
public: __property System::Object __gc * get_Item(System::Int32
index);public: __property void set_Item(System::Int32 index, System::Object
__gc * value);
// Fields
private: System::Collections::ArrayList __gc * items;
};
public __gc class Form1 : public System::Windows::Forms::Form
{
// Methods
public: Form1();
protected: override void Dispose(System::Boolean disposing);
private: void Form1_Load(System::Object __gc * sender,
System::EventArgs __gc * e);
private: void InitializeComponent();
[System::STAThread]
private: static void Main();
// Fields
private: System::ComponentModel::Container __gc * components;
private: System::Windows::Forms::TextBox __gc * txtIteratorText;
};
private __gc class Item
{
// Methods
public: Item(System::String __gc * name);
// Properties
public: __property System::String __gc * get_Name();
// Fields
private: System::String __gc * name;
};
private __gc class Iterator : public Iterator::AbstractIterator
{
// Methods
public: Iterator(Iterator::Collection __gc * collection);
public: override Iterator::Item __gc * CurrentItem();
public: override Iterator::Item __gc * First();
public: override System::Boolean IsDone();
public: override Iterator::Item __gc * Next();
// Properties
public: __property System::Int32 get_Step();public: __property
void set_Step(System::Int32 value);
// Fields
private: Iterator::Collection __gc * collection;
private: System::Int32 current;
private: System::Int32 step;
};
}
Any questions?
Yama