I have a .NET_4 Managed C++ ref class that I derive from a .NET_4 base class written in C#.
C# base class:
namespace Core
{
public class ResourceManager
{
public class _Resource
{
public virtual void Delete() {}
}
}
}
Managed C++ class:
namespace Input.DI
{
public ref class Mouse : ResourceManager::_Resource
{
public:
virtual void Delete() {}
};
}
Here is the error I'm getting:
'Input::DI::Mouse::Delete' : matches base ref class method 'Core::ResourceManager::_Resource::Delete', but is not marked 'new' or 'override'; 'new' (and 'virtual') is assumed
What is the correct managed C++ syntax to override a virtual
function from a C# class?
You put override
after the function signature.
//MANAGED C++ CLASS
namspace Input.DI
{
public ref class Mouse : ResourceManager::_Resource
{
public:
virtual void Delete() override {}
};
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With