• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

VB Equivalent to C++ Constructors & Destructors

The closest match in VB to a C++ destructor is an implementation of System.IDisposable.

C++ VB
class Foo
{
public:
    Foo() : Foo(0)   //call to other constructor
    {
    }
    Foo(int i)
    {
    }

    //destructor
    ~Foo()
    {
    }
};
Public Class Foo
    Implements System.IDisposable

    Public Sub New()
        Me.New(0)   'call to other constructor
    End Sub
    Public Sub New(i As Integer)
    End Sub

    Public Sub Dispose() Implements IDisposable.Dispose
    End Sub
End Class


Use C++ to VB Converter to convert from C++ to VB.NET.     

Additional resource: VB.NET and C++ Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.