I\'m trying to run a legacy VB6 application on my desktop (it doesn\'t have a user interface, being a command-line app), and when I do, I get a message box saying
I have VB6 SP6 and I can reproduce this behavior. In a fresh project, put this code into a form. The project runs normally with F5. Right click the project and select Publish then Build Outputs. This generates the error message.
Option Explicit
Public Sub Init()
Dim blnErrorHandling As Boolean
If False Then
blnErrorHandling = True
Else
blnErrorHandling = False
End Sub
Now comment out the last four lines:
Option Explicit
Public Sub Init()
Dim blnErrorHandling As Boolean
' If False Then
' blnErrorHandling = True
' Else
' blnErrorHandling = False
End Sub
You no longer get the error and the outputs are built normally. I was quickly adding in some error handling to locate the source of a crash and If False Then is perfectly valid. The MDAC checker said all was ok and a reboot didn't solve the problem.