VBUC Documentation | Mobilize.Net
Mobilize.NetForumsBlogDocumentation Home
  • Mobilize.Net VBUC
  • Introduction
  • Install and Licenses
  • Get Started
  • Migration Guide
  • VBUC Features
  • Mappings Grammar
  • Generated Code
  • Upgrade Options
    • Data Access
    • Grids
    • Microsoft
    • Sheridan
    • Others
    • Code Conversion
    • C# Features
  • Third-party controls
  • Best Practices
  • EWIs
    • Warnings
    • Issues
    • ToDos
    • Notes
  • Issues and Troubleshooting
    • Microsoft.VisualBasic Uses
    • Safe and Unsafe Methods Layer
    • Third Party Components
    • Migration Process
    • Classic ADO Conversion to ADO.NET
    • VB6 and .NET integer division
    • VB6 On Error Statements
    • Running a .NET Core application in a machine with no Visual Studio installed
    • Databases issues
    • Unsupported assemblies on .NET Core and .NET 5
    • Icon Extraction Issues
    • HTTPS sites are not loaded in Windows XP
    • Short-Circuit Boolean Logic in C#
    • Assessment Report Issue
  • Knowledge Base
    • FAQ
      • Does the VBUC support the Sheridan VB 6.0 controls suit?
      • How effective is the Visual Basic Upgrade Companion tool at converting an application's front end?
      • What controls does the Visual Basic Upgrade Companion tool supports?
      • How does the VBUC handle VB6 Collections?
      • Can the VBUC migrate intrinsic VB6 functions and libraries?
      • Where is the source code for the support (helper) classes used by the VBUC?
      • How does the VBUC convert ADO to ADO.NET?
      • Can the Visual Basic Upgrade Companion tool be customized?
      • What are Stubs?
    • How-To
      • App.Config and Database Access
      • Avoid reflection in Hot Paths
      • Convert ESRI ArcGIS Visual Basic 6.0 applications to .NET
      • Drag and Drop Conversion Steps
      • Inserting elements in a ListView
      • String vs StringBuilder
      • Word Automation in VB6 vs .NET
      • Configure default Factory Database provider
      • GetPrivateProfileString Windows API working in migrated code
      • Upgrade projects with shared files
  • Release Notes
Powered by GitBook
On this page

Was this helpful?

  1. Knowledge Base
  2. FAQ

How does the VBUC handle VB6 Collections?

VB6 Collections could be indexed with either a string key (HashTable-style) or an integer (ArrayList-style).

In .NET, we have HashTables that can be indexed with a key and ArrayLists that can be indexed with integers, but we don't have this "hybrid" class that can have both types of access.

When you migrate, the VBUC can detect the way in which you are accessing Collections in your code, and based on that, it infers the appropriate replacement. However, for this inference to work correctly in all cases, the usage of each Collection in VB6 must be very uniform and consistent throughout the code (i.e. you can't mix ArrayList-like and HashTable-like access on the same instance of a Collection). Furthermore, if a VB6 Collection contains only String objects, the VBUC may convert that collection to the .NET StringCollection class (for ArrayList-like access) or to the .NET StringDictionary class (for HashTable-like access).

This is a good alternative to the backward compatibility VB6.Collection class (the default conversion for Collections in the VBUC), but may lead to numerous manual changes if the usage of Collections in the VB6 source code is not uniform.

PreviousWhat controls does the Visual Basic Upgrade Companion tool supports?NextCan the VBUC migrate intrinsic VB6 functions and libraries?

Last updated 2 years ago

Was this helpful?