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


  • It's the exact same problem I'm having, you're just getting there a different route. You've got cmds declared as Object, when it should be declared PCDLRN.Commands. I've got a bad feeling that this is a problem with the way all of the pc-dmis collections are setup. Hoping like crazy that I'm wrong, and there's just something that I don't know.


    Hate to say it but I didn't have much time to look into it therefore I didn't have time to get it done 'right'. It worked and I moved on with the intent to go back to solve it, totally forgot about it and it's been in production for about 1.5yrs without an issue. You can even see me scrambling thru code that works based on my comments haha....

    Original snippet:
    Dim app As PCDLRN.Application 'PCDLRN.Application
    Dim cmds As Object 'PCDLRN.Commands
    Dim cmd As PCDLRN.Command 'PCDLRN.Command
    Dim part As PCDLRN.PartProgram 'PCDLRN.PartProgram
    'Dim parts As PCDLRN.PartPrograms 'PCDLRN.PartPograms
    Dim s As String = "" 'string to hold dimensions ID
    Dim r As Integer = 1 'row
    
Reply


  • It's the exact same problem I'm having, you're just getting there a different route. You've got cmds declared as Object, when it should be declared PCDLRN.Commands. I've got a bad feeling that this is a problem with the way all of the pc-dmis collections are setup. Hoping like crazy that I'm wrong, and there's just something that I don't know.


    Hate to say it but I didn't have much time to look into it therefore I didn't have time to get it done 'right'. It worked and I moved on with the intent to go back to solve it, totally forgot about it and it's been in production for about 1.5yrs without an issue. You can even see me scrambling thru code that works based on my comments haha....

    Original snippet:
    Dim app As PCDLRN.Application 'PCDLRN.Application
    Dim cmds As Object 'PCDLRN.Commands
    Dim cmd As PCDLRN.Command 'PCDLRN.Command
    Dim part As PCDLRN.PartProgram 'PCDLRN.PartProgram
    'Dim parts As PCDLRN.PartPrograms 'PCDLRN.PartPograms
    Dim s As String = "" 'string to hold dimensions ID
    Dim r As Integer = 1 'row
    
Children
No Data