Results 1 to 40 of 47

Thread: how convert VB6 to VB2010 code?

Threaded View

  1. #9

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: how convert VB6 to VB2010 code?

    correct me: the 'structure' is like 'class'?
    (i'm asking, because we can use 'Initialize' function and we can add functions)
    from VB6:
    Code:
    Private Type SAFEARRAY2D
        cDims As Integer
        fFeatures As Integer
        cbElements As Long
        cLocks As Long
        pvData As Long
        Bounds(0 To 1) As SAFEARRAYBOUND
    End Type
    to VB2010:
    Code:
    Private Structure SAFEARRAY2D
            Public cDims As Integer
            Public fFeatures As Integer
            Public cbElements As Long
            Public cLocks As Long
            Public pvData As Long
    
            <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)>
            Public Bounds() As SAFEARRAYBOUND
    
            Public Sub Initialize()
                ReDim Bounds(2)
            End Sub
        End Structure
    is these correct?
    Last edited by joaquim; Feb 18th, 2024 at 06:19 AM.
    VB6 2D Sprite control

    To live is difficult, but we do it.

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