hexagon logo

Need help with VB6 .Net

Upgraded my workstation to Windows 10, so VB6 is no longer an option for my PC-DMIS software efforts.

I've got Visual Studio 2107 now, and I've run into a problem using PC-DMIS collections. In a nutshell, vb6 .net doesn't recognize them as collections. I have to declare the PC-DMIS application as "Object" in order to be able to enumerate through the collections. I was told that this means it's doing "late binding" - who cares. I need intellisense because I'm a terrible typist. In the screenshot below, if I change the declaration of the "app" variable to type "Object", the compile error goes away, and the code runs fine. But I don't see this as a solution.

I'll also point out that the Microsoft's File System Object collections work just fine when used in the same manner.

Has anyone got the solution to this problem?


  • A reference to the latest INTEROP.PCDLRN.DLL fixed this issue for me !

    Edit: Wait it worked for other commands like
    cmds.SetCurrentCommand(cmds.LastCommand)
    

    but not for
    For Each cmd In cmds
    


    Bummer!
  • Yeah, it won't work for .Commands("PNT1") either. I spent some time fiddling with it at work today. I've decided I need professional help (wife's been saying this for years), so when I feel like I've got some time I'll get help (been telling my wife that for years) Slight smile

    Meantime, all pcd collections are Objects. This is a very small issue compared to the task of recording vb6 to .net - it isn't a minor thing.
  • I am sure the Hexagon guys knows hows to solve this.

    Let's try and ping to see if he got a pointer to as who is in charge for COM/OLE automation?
  • I'm a little bemused at the consternation this is causing.

    When I fist switched to .net I found For Each Next didn't work - it was no real hardship to use...

    Dim cmds As PCDLRN.Commands = part.Commands Dim cmd As PCDLRN.Command For i = 1 To cmds.Count cmd = cmds.Item(i) Next i Just like using messagebox.show instead of msgbox, or dropping the SET keyword when decalring object variables - just one more thing to remember.
  • I'm a little bemused at the consternation this is causing.

    When I fist switched to .net I found For Each Next didn't work - it was no real hardship to use...

    Dim cmds As PCDLRN.Commands = part.Commands Dim cmd As PCDLRN.Command For i = 1 To cmds.Count cmd = cmds.Item(i) Next i Just like using messagebox.show instead of msgbox, or dropping the SET keyword when decalring object variables - just one more thing to remember.


    You're right of course. I am well aware of the approach you posted. If you look at my 12.1 comment you'll see that I basically agree. However, something isn't right - and I intend to see it corrected eventually.