Forum Discussion
Windows 11 ARM 24H2 - Problems with VB6 compile with P-Code
Hello,
I work for a company that supports its legacy applications developed using Visual Basic 6 (VB6).
These applications are compiled to P-Code, not native code.
I know that Microsoft seems to have changed the emulator used on ARM in order to optimize operations.
https://learn.microsoft.com/en-us/windows/arm/apps-on-arm-x86-emulation
With 24H2, we have a problem with a mathematical calculation.
With 23H2, the operation 30 + (0 x 2 ^ 8) = 30
With 24H2, the operation 30 + (0 x 2 ^ 8) = 0
Here is an example of a procedure to reproduce the problem :
Private Sub Command1_Click()
Dim Valeur1 As Long
Dim Valeur2 As Long
Dim Exposant As Integer
Dim Resultat As Long
Valeur1 = 30
Valeur2 = 0
Exposant = 8
Resultat = Valeur1 + (Valeur2 * 2 ^ Exposant)
Call MsgBox("30 + (0 x 2 ^ 8) = " & Str$(Resultat))
End Sub
For your information, if I compile one of our modules in native code, the problem does not exist.
The problem only exists in P-Code.
I can also fix the situation by modifying change emulation setting on the shortcut.
Has anyone else had this problem?
THANKS !
Sylvain