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
  • Unfortunately I haven't done *any* work in VB.NET (I use the superb Delphi (Pascal) environment when not programming PC-DMIS Basic, Excel or other exotic languages). Actually, I haven't done anything .NET...

    I believe a collection must implement a certain interface/iterator to have "for each" to work - it looks like PC-DMIS is not doing it (or exporting it) in exactly the right way.

    In theory, it looks like you should be able to write an iterator in VB - https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/for-each-next-statement might give some clues for a workaround.
  • Bummer.

    Thanks for the tip about the iterator, I was looking at documentation on this myself.

    My main want is to easily convert all of my code that is used in production. Looks like that isn't going to be possible. I'll have to do some re-coding, which opens up the opportunity for error. Oh well, I've been ignoring this VB6 obsolescence topic for many years, so it's largely my fault. It's going to take more time than I'd like to spend.

    You've stated previously here that you use Pascal. I used to have a Borland Turbo Pascal compiler many years ago. Back in the day befire the fancy IDE's. I liked the language - but haven't used it in decades.
Reply
  • Bummer.

    Thanks for the tip about the iterator, I was looking at documentation on this myself.

    My main want is to easily convert all of my code that is used in production. Looks like that isn't going to be possible. I'll have to do some re-coding, which opens up the opportunity for error. Oh well, I've been ignoring this VB6 obsolescence topic for many years, so it's largely my fault. It's going to take more time than I'd like to spend.

    You've stated previously here that you use Pascal. I used to have a Borland Turbo Pascal compiler many years ago. Back in the day befire the fancy IDE's. I liked the language - but haven't used it in decades.
Children
No Data