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

What are Stubs?

A stub is a function that has no definition, so it doesn't do anything but it could be helpful when stabilizing a migrated application.

PreviousCan the Visual Basic Upgrade Companion tool be customized?NextHow-To

Last updated 2 years ago

Was this helpful?

The VBUC converts library elements to their equivalent when possible, but it is possible some elements could not be uograded because there aren't direct equivalents in the target component. For these non-updated element, the generated code will include a comment indicating that the expression/statement was not converted. The Upgrade Stubs Generation feature creates a dummy (stub) declaration for each kind of these elements.

This approach could be very important as part of a modernization strategy to get a migrated application stable.

Whenever a stub method is executed, it will display a message box like the one below (remember, stubs are dummy methods):

This warning means that you need to fix something (click “No“ to see what is happening and review the Call Stack to know which line must be implemented). Ignoring this, may generate crashes in the business logic, or modify the expected behavior.

However, beyond the fact a component/library element was not upgraded, stubs would be important in your conversion estrategy:

  1. Reduce compilation errors. When there is no equivalent for a method/property, the default behavior of the VBUC is just adding a comment indicating the following expression/statement was not converted and requires manual correction. This might cause a number of compilation errors that might hide other issues that need to be resolved manually.

  2. Encapsulation. It provides a centralized way to provide solutions. Once a stub is implemented, this solution will be available in all places in migrated code using this stub.

The above second point (encapsulation) will require analyze how to implement a funcitonality for a given stub. This imply knowledge in source and target languages (i.e. VB6 and C#/VB.Net) and deep engineering skills. Any implementation for a stub needs to understand what was the purpose of the stub in the original language and how it could be emulated in the target language: A stub exists because it doesn't exists a direct equivalent.

The following questions are a good start point to implement functionality for stubs:

  • What happened before this line?

  • What will happen after this line?

  • What says the Documentation?

  • In which control is used?

In the best scenario, you already know which should be the expected line (it will require .Net knowledge). In other cases, you need to research about the target .Net Control on how to emulate the not-upgraded element. Also, it could be possible stubs can not be fixed until you find a specific workflow that brings context about the purpose of the not-upgraded element.

NOTE: If you want to learn more about the Stubs Generation Upgrade Option will be of interest.

this post