#include "stdafx.h"
using namespace System;
interface class MyInterface{
void f();
};
ref class MyClass : MyInterface{
public:
void f()
{
Console::WriteLine("MyClass::f");
}
virtual void fMyInterface() = MyInterface::f
{
Console::WriteLine("MyClass::fMyInterface implementing MyInterface::f");
}
};
int main()
{
MyClass^ a = gcnew MyClass();
MyInterface^ ia = a;
ia->f();
a->f();
}