overriding C++/CLI Dispose in C#
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
I'm having a problem trying to override IDisposable.Dispose() in a C#
class that inherits a C++/CLI class that implements Dispose(). The
compiler says
Error 13 'JM.UI2.EditBoxDataModel.Dispose()': cannot override inherited
member 'JM.UI.Base.Dispose()' because it is not marked virtual,
abstract, or override
C:\depot-jmatzen-dell\depot\game14\src\engine\UI2\UIEditBox.cs 19 26 UI2
But in fact, in my base class I have ~Base() declared as virtual (and I
think it's virtual by default anyway but that's beside the point):
virtual ~Base();
Here's my C# class
public class EditBoxDataModel
: Base
{
public override void Dispose()
{
}
};
Any thoughts?
.
Relevant Pages
- Re: Microsoft Speech SDK 5.1
... I am assuming at some point the Dispose method underwent a change (possibly ... Now, if you type in "override" in the code, VS will popup a list of all the ... >> actually a problem with the speechlib at all, just a change that was made ... >> Adam Clauss ... (microsoft.public.dotnet.languages.csharp) - Re: Microsoft Speech SDK 5.1
... find that line where Dispose is declared... ... protected override void Dispose ... (AKA - you could create your own app, add a reference to SpeechLib ... Adam Clauss ... (microsoft.public.dotnet.languages.csharp) - Re: BeginAccept callback problem
... documentation says 'override' keyword can be used only on static or virtual ... be there is a way of 'knowing' the socket is disposed by wrapping the socket ... within a state object. ... mean regarding to Dispose, ... (microsoft.public.dotnet.languages.csharp) - Re: fxcop - Dispose pattern analysis
... When subclassing I can override Dispose and extend its functionality using ... "new Dispose" declaration. ... Which is impossible as Dispose is not an override - it is "public new". ... (microsoft.public.dotnet.general) - Re: BeginAccept callback problem
... You are right, it compiles and works. ... documentation says 'override' keyword can be used only on static or virtual ... be there is a way of 'knowing' the socket is disposed by wrapping the socket ... mean regarding to Dispose, ... (microsoft.public.dotnet.languages.csharp) |
|