Results 1 to 4 of 4

Thread: convert c#'~' to vb.net

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2003
    Posts
    23

    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

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    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

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    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.
    Dont gain the world and lose your soul

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2003
    Posts
    23

    Thanks guys

    Its right, it is a destructor. We should use
    finalise() or TwCapability()?

    Anyway Thanks guys by helping me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width