Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

We have this VB6

Code Block
    Dim wb As WebBrowser    
    Set wb = New WebBrowser
    
    Dim v As Variant    
    v = wb.Document.All("ID").innerText

The initial translation is:

    v = ((object)((dynamic)wb.Document).All("ID").innerText());
    

The presence of dynamic here indicates the tool was not able to fully resolve the expression. The code builds, but it may lead to runtime problems during testing.

Analysis and Migration Rules

The first weak link in the expression is WebBrowser.Document. This property is weakly typed in COM:

...

The resulting translation is clean and builds in .NET.

inline method

The approach above used two RefactorLibrary files and registered them with commands in the translation script:

...