-
convert c#'~' to vb.net
I find this c# and I want to translate it into vb.net code but I could. I found inside msdn it says it is an OnesComplement. I post the code in c# and if any one know hor to convert this to vb.net code please help me.
~TwCapability()
{
if( Handle != IntPtr.Zero )
Twain.GlobalFree( Handle );
}
Thanks
-
When I uset the translator Here i got the following, could that be right ?
Code:
Overrides Sub Finalize()
If Handle <> IntPtr.Zero Then
Twain.GlobalFree(Handle)
End If
MyBase.Finalize()
End Sub
-
Yes thats right. The tilde (~) is used for a destructor function in a class. In VB.NET you have to override the Finalize function to implement your own destructor.
-
Thanks guys
Its right, it is a destructor. We should use
finalise() or TwCapability()?
Anyway Thanks guys by helping me.