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?


Parents
  • Doesn't work - I've not done much with vb.net for a while so looked in an old project.

    Use this instead...


    
    Dim cmds As PCDLRN.Commands = part.Commands
    Dim cmd As PCDLRN.Command
    
    For i = 1 To cmds.Count
    cmd = cmds.Item(i)
    Next i
    
    
  • Yup, there are alternatives. I think for my "serious stuff" that we use in production though, just changing the variable declaration(s) to "Object" is going to be the quickest/safest way. And these are .exe's - there's a slight chance that I'll never need to make changes to the code. But of course right now, I have on that's got to be updated. Haven't touched this code in years, and then a couple weeks after I get Windows 10...
Reply
  • Yup, there are alternatives. I think for my "serious stuff" that we use in production though, just changing the variable declaration(s) to "Object" is going to be the quickest/safest way. And these are .exe's - there's a slight chance that I'll never need to make changes to the code. But of course right now, I have on that's got to be updated. Haven't touched this code in years, and then a couple weeks after I get Windows 10...
Children
No Data