1

I am trying to install a VB6 application in Windows 10 computers, but when I load a child form and then unload it, the program crashes. If I start the application as Administrator from the shortcut, I can load and unload everything without issues. Have you experienced this before?

So far I've tried the following:

  • Started the .exe directly as Administrator. Not working.
  • Checked the Run As Administrator checkbox in the contextual menu (Properties / Compatibility) of the .exe. No good.
  • Created a .reg file to affect the HLKM\ ... \AppCompatFlags\Layers keys. Nada.
  • Tried affecting both the HKLM AND HKCU keys. Thank you, next.
  • Checked if some Recordset or variable was filled or active. Everything empty.
  • Tried Unload [name of the form] instead of Unload Me for one of the forms. Same result.

Part of the Unload code for one of the forms is as follows:

Private Sub cmdSalir_Click()
On Error GoTo ErrHandler

Dim frm As Form       'Identifica las formas a cerrar
    For Each frm In Forms
        If Not frm Is frmPoliza And Not frm Is MDIPrincipal Then
            If Not frm Is frmAsegNoReclam And Not frm Is frmEndosoMedico Then _
                Unload frm
            End If
    Next frm
    gsPlan = ""
    gmstrInstPagoInd = ""
    gmstrCondEnv = ""

    If IsFormLoaded("frmCotiza") = False Then
        'gbInicio = True
    End If

    Unload Me
ErrHandler:                 'APM 2019-01-31: Captura el error que se provoca al descargar la forma
    If Err.Number <> 0 Then
        MsgBox "Ocurrió un error al cerrar: " & Err.Number & " - " & Err.Description, vbOKOnly
    End If
End Sub

It is important to say that WinXP's installations are working correctly, but in 2 Win10's computers the error was replicated, so I'm guessing either Win10's security policies or the way the installation package is made has something to do with this.

If you can help me with this issue, I will appreciate it greatly.

Thank you,

Tony.

Toño Pérez
  • 115
  • 2
  • 7

3 Answers3

0

If the issue is that you need to run with elevated rights, then I suggest you declare that in you application manifest such that the user is prompted grant that. You can either create a separate manifest file or embed it. See here for details:

How do I create a manifest file in Visual Basic 6.0?

tcarvin
  • 10,715
  • 3
  • 31
  • 52
0

So I told the client about this issue, and decided to have the program virtualized in XP better than adapted to x64. Not the closing I wanted, but a closing after all.

Thank you all for your efforts.

Toño Pérez
  • 115
  • 2
  • 7
0

Not sure if this will fix the specific problem but have found that running the application in Windows 8 Compatibility Mode on Windows 10 helps with issues like this. Worth a try.