VB Migration Partner

Migration warnings and issues

Another way to compare VB6 migration tools is to check the list of migration warnings that they emit. We have carefully scrutinized all VBUC’s Errors, Warnings and Issues (EWIs), using its online documentation. It’s worth noticing that, seven years after VBUC inception, this documentation hasn’t been completed yet and many EWIs are still not documented (as of mid-October 2009).

The following table lists all documented VBUC EWIs, with their numeric code and official name. The 3rd column contains the signed or signedP symbol symbol if VBMP fully or partially supports the corresponding feature (and can therefore avoid to emit a message). We have omitted EWIs related to previous versions of VBUC and EWIs that can be emitted only when converting to C#.

Issue
1002 LSet cannot assign one type to another
signedP
This is an intrinsic VB.NET limitation. VBMP solves this problem in a subset of all possible cases.
1010 The preceding lines couldn’t be parsed   In the rare occurrence of an internal error, VBMP emits a similar message. In practice it happens only when the original VB6 code isn’t correct and would fail to compile.
1014 %1 statement isn’t supported
signed
VBMP supports Gosub, On Goto, On Gosub and virtually all the documented VB6 keywords.
1016 Declaring a parameter As Any is not supported
signed
VBMP fully supports As Any parameters in Declare statements.
1039 Load statement is not supported
signed
VBMP fully supports Load and Unload statements with forms.
1040 %1 function is not supported
signedP
Unlike VBUC, VBMP supports the IsMissing function and partially supports the VarPtr undocumented keyword.
1043 Class instancing was changed to Public
signed
VBMP takes care of all the implications of changing a class’s visibility.
1046 %1 parameter “%2” is not supported and was removed
signedP
Like VBUC, VBMP doesn’t support the size, colorDepth, x, and y parameters in LoadPicture method. Unlike VBUC, VBMP does support all parameters in the AppActivate method.
1050 Structure %1 may require marshaling attributes to be passed as an argument in this Declare statement
signed
In virtually all cases VBMP generates the correct MarshalAs attributes for structures passed to Declare statements.
1058 Assignment not supported: KeyAscii to a non-positive constant (blank page)
signed
VBMP correctly handles this scenario.
1060 COM expression not supported (blank page)
?
(not enough info to decide whether VBMP emits a similar warning)
1064 Try/Catch not supported with On Error Goto statements in same method (blank page)   This is an intrinsic VB.NET limitation. VBMP emits a similar warning in this case.
2036 Property %1 doesn’t support custom mousepointers
signed
VBMP correctly handles custom mouse pointers.
2038 Form property %1.ScaleMode is not supported
signed
VBMP correctly handles runtime assignments to the ScaleMode property and fully supports user-defined coordinate systems and negative values for ScaleWidth and ScaleHeight properties.
2042 A string cannot be used to index the Controls collection
signed
VBMP correctly migrates numeric and string indexes in the Controls collection.
2049 Unable to determine which constant to upgrade %1 to. Its original numerical value (%2) was used instead. (blank page)
signed
All VBMP enum values retain the original VB6 value, therefore using the original numeric value is never an issue.
2050 %1 Event %2.%3 was not upgraded
signed
VBMP fully supports all drag-and-drop events and, with very few exceptions, all VB6 events that have no direct counterpart under .NET.
2059 %1 Property %2.NewIndex was not upgraded
signed
VBMP correctly migrates the NewIndex property.
2064 %1 %2 %3.%4 was not upgraded
signed
VBUC can generate stub methods to avoid compilation errors related to controls’ members that have no .NET counterpart, but you later have to implement the missing members. VBMP directly supports the vast majority of all VB6 controls’ properties and methods, no manual fixes are necessary
2067 %1 control %2 was not updated (blank page)
signed
VBMP can translate all the controls in the VB6 toolbox, with the only exception of OLE container and DataRepeater.
2068 %1 was not upgraded
signedP
VBMP correctly migrates VB6-specific objects such as PropertyBag.
2069 %1 Property %2 was not upgraded
signed
VBMP correctly migrates VB6-specific objects such as PropertyBag and all their properties and methods.
2070 Constant %2 was not upgraded
signed
VBMP correctly converts all constants defined in VB and VBA libraries.
2072 %1 %2 could not be resolved because it was within the generic namespace %3
signed
VBMP correctly handles late-bound calls to methods defined in Form classes.
2074 %1 property %2 was upgraded to %3 which has a new behavior
signed
VBMP preserves 100% functional equivalence of controls’ properties and methods.
2080 %1 was upgraded to %2 and has a new behavior
signed
VBMP preserves 100% functional equivalence of controls’ properties and methods.
2081 %1 has a new behavior
signed
VBMP preserves 100% functional equivalence of controls’ properties and methods.
6002 UserControl event %1 is not supported
signed
VBMP supports the majority of UserControls properties, methods, and events.
6003 %1 %2 was not upgraded
signed
VBMP correctly migrates VB6-specific objects such as PropertyBag and all their properties and methods.
7002 It cannot be completely determined if Forms.Controls returns a default property or a control array (blank page)
signed
VBMP doesn’t suffer from this problem.
7003 The hDC should be released once it is used for safety   VBMP emits this message too.
7007 Comparison between object type need a review (blank page)
signed
Object type comparison is never a problem with VBMP.
7008 The ProgID could not be found on computer when this application was migrated
signedP
In most cases VBMP can handle this case nicely.
Warning
1003 ParamArray %1 was changed from ByRef to ByVal
signed
VBMP detects whether a ParamArray element is assigned to inside the method and correctly generates code that implements the original ByRef semantics.
1037 Couldn’t resolve default property of object %1
signed
By default VBMP emits a similar message, but you can use a DefaultMemberSupport pragma to generate calls to a helper method that resolves the default property at runtime.
1041 %1 was upgraded to %2 and has a new behavior
signed
VBMP correctly converts all B-suffixed string functions (e.g. LenB, LeftB, etc.)
1043 Class instancing was changed to public
signed
VBMP automatically changes the class visibility and generates code that ensures that original behavior is preserved.
1044 Sub Main in a DLL won’t get called
signed
VBMP correctly generates some code to ensure that the Sub Main method is invoked at the right time even when inside a DLL.
1047 Application will terminate when Sub Main finishes
signed
VBMP provides a workaround for this issue.
1048 Add a delegate for AddressOf %1
signed
VBMP automatically generates the delegate definition in such cases.
1063 Arrays in structure %1 may need to be initialized before they can be used
signed
VBMP generates the code that initializes a structure before it is used, and correctly creates arrays, fixed-length strings, and As New objects.
1068 %1 variable of type Variant is being forced to scalar
signed
VBMP supports type inference and can attempt to detect the most suitable type for all Variant and Object variables.
2065 %1 event %2 has a new behavior
signed
All form and control events retain the original behavior under VBMP. There are very few exceptions to this rule and all of them are thoroughly documented in our knowledge base.
2075 Event %1.%2 may fire when form is initialized (blank page)
signed
VBMP ensures that all control events are disabled while the form is being initialized.
6022 The CommonDialog CancelError property is not supported in Visual Basic .NET
signed
VBMP fully supports the CancelError property.
7009 Multiple invocations to ShowDialog in forms with ActiveX controls might throw runtime exceptions
signed
This issue is related to a bug of Microsoft COM Interop.
Note
7001 The following declaration %1 seems to be dead code
signed
VBMP emits a similar message when spotting unused or unreachable code; you can use RemoveUnusedMembers and RemoveUnreachableCode pragmas to automatically remove or comment out the unused code.
Todo
1035 #If #EndIf block was not upgraded because the expression %1 did not evaluate to True or was not evaluated   Like VBUC, VBMP can’t correctly migrate code in #IF portions whose condition is false.
1059 Code was upgraded to %1 which may not have the same behavior
signed
VBMP correctly handles assignments between strings and Byte arrays.
1065 Error handling statement (%1) could not be converted properly. A throw statement was generated instead.
signed
If VBMP can’t convert an On Error statement to Try/Catch, it leaves the unchanged statement in code, which ensures that functional equivalence is preserved.
1066 %2 is defined by a CreateObject method, which class name isn’t registered
signed
VBMP never attempts to solve ProgIDs passed as arguments to CreateObject method.
1067 Member %2 is not defined in type %3
signed
VBMP doesn’t emit this message because in general migrated controls expose members with same name as the original VB6 controls, therefore everything works fine even in late-bound scenarios.
1069 Error handling statement (%1) was converted to a complex pattern which might not be equivalent to the original
signed
If an On Error statement can’t be reliable converted to a 100% equivalent Try/Catch block, VBMP preserves the original On Error statement.
2018 Remove the next line of code to prevent form from automatically showing
signed
VBMP fully support the AutoShowChildren property and ensures that MDI child forms behave like in VB6.
2045 Only TrueType and OpenType fonts are supported in Windows Forms
signed
VBMP automatically converts unsupported fonts into the closest TT or OT equivalent font; in addition, the FormFont, ReplaceFont, and ReplaceFontSize pragmas gives you full control over fonts used in forms and controls
7010 The connection string must be verified to fulfill the .NET data provider connection string requirements
signed
This is never an issue with VBMP, regardless of whether you use ADODB objects or migrate to ADO.NET by means of the ADOLibrary.

Here’s a quick recap of our findings:

  • VBUC can emit 57 different EWI messages, related to VB6 features that it fails to migrate correctly.
  • In 8 cases, the EWI message is associated with a blank page, leaving users without a clue about how to fix the problem.
  • VBMP supports a much wider range of VB6 features, and in fact emits only 4 messages related to unsupported features, plus 3 messages related to features that are supported only partially

VBMP generates 10-12x fewer warnings than VBUC on the average, thus you can expect a proportional increase in productivity in real-world migration projects (and a proportional decrease of migration costs).

Each EWI from VBUC contains the URL of a web page that explains the problem and how to fix it. (In theory at least, because a few URLs lead you to a blank page…). In addition to getting information on individual warnings, VBMP users can quickly obtain a report that recaps all the warnings in the generated code *and* the recommendations for each of them. It’s a minor detail that saves you precious minutes and immediately provides an overview of the overall effort and expertise that are necessary to successfully complete the migration.