Getting old VB6 programs to run in V6

I have a couple old VB6 drilling programs that I’m not quite ready to give up on yet. I need to make some changes to get them to load in V6, but the changes are not as straightforward as changing the “5” to a “6” in the code below. What do I need to change to make the programs run in V6?

Dim i As String
Dim objFso As Object
    Set Rhino = CreateObject("Rhino5x64.Interface")
    If (Err.Number <> 0) Then
        Call MsgBox("Failed to create Rhino 5 object. Rhino must be running for this plug-in to function.", 16, "Hole Drilling Program")
        Exit Sub
    End If
    Dim nCount As Integer
    nCount = 0
    Do While (nCount < 10)
        On Error Resume Next
        Set RhinoScript = Rhino.GetScriptObject()
        If Err.Number <> 0 Then
            Err.Clear
            Sleep 500
            nCount = nCount + 1
        Else
            Exit Do
        End If
    Loop
    If (RhinoScript Is Nothing) Then
        Call MsgBox("Failed to start the RhinoScript engine.")
    End If

Thanks,

Dan

I don’t have VB6 any more (so I can’t even look at code I wrote on it many years ago) … but I read somewhere that the “recommended” way is to use Visual Studio (VB.Net) and let it translate VB6 into VB.net

Yeah, I tried that years ago. It fails so badly that it’s basically a re-write.

Hi @DanBayn,

Is there a reason you just don’t use V5, which works?

— Dale

Yes, we’ve been running my programs in V5 all along. I’m just preparing for the release of V6 so that I will be ready to upgrade when it’s released.

Hi @DanBayn,

Does this help?

http://developer.rhino3d.com/api/rhinoscript/introduction/external_access.htm

– Dale

Yes, that helped a lot. It’s working as expected in V6.

Thanks,

Dan