-
Aug 21st, 2017, 04:16 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Debug advice needed
Hi all,
I have a program that installed fine on hundreds of different PCs.
And runs fine of course.
No issue since years.
But now I have a PC where the program installs but doesn't run.
No error message, in the event manager just 'Doesn't work' and no hint where to look at.
The program itself starts from Sub Main, there is InitCommonControls etc.
Then it loads the main form.
I modified the program to write a debug file.
In every 2nd line of the source this kicks in.
It stops working just before Load frm_Main.
So no further output...
Only standard OCXs are used (COMCTL32.OCX etc.).
And yes, all the satellite files are there for the program.
This all is double and triple checked.
---
Any idea how to debug further?
Thanks,
Karl
-
Aug 21st, 2017, 04:51 AM
#2
Re: Debug advice needed
Are there any differences with this new PC and the other, working PCs? Operating System, 32 / 64 bit, installed updates etc. If you wrap the Load frm_Main in an error handler does the error message give you any information?
-
Aug 21st, 2017, 05:17 AM
#3
Thread Starter
Fanatic Member
Re: Debug advice needed
Are there any differences with this new PC and the other, working PCs? Operating System, 32 / 64 bit, installed updates etc.
Sure there are differences.
But nothing special in this case.
In fact the unwilling PC is quite similar to the one I work on.
If you wrap the Load frm_Main in an error handler does the error message give you any information?
The error handler is of course there.
But as the form doesn't load, it can't do anything for me.
That's the problem...
-
Aug 21st, 2017, 06:31 AM
#4
Re: Debug advice needed
Does it use a manifest? If so, can you send them a test setup without one and starts with main form, not Sub Main. If it works, you likely narrowed the problem down: manifest or the Sub Main initialization of Shell32. If your test setup works in this scenario and you need more help, you'll probably need to show us your Sub Main and manifest. If it still fails to load, at least one more potential issue was eliminated. Good luck.
Edited:
If you wrap the Load frm_Main in an error handler does the error message give you any information?
Maybe the question better asked: Is the 1st line of Form_Load (or Form_Initialize if used), a statement that writes to file? If so, and nothing is written, then it does kinda limit it to Sub Main, project references, and/or failed dependency registration I'd think.
You might want to get the exact wording of the Windows event log entry too.
Last edited by LaVolpe; Aug 21st, 2017 at 07:08 AM.
Reason: typo
-
Aug 21st, 2017, 06:43 AM
#5
Re: Debug advice needed
I use MZTools to add error templates to the routines.
Example of a basic forms:
Code:
Option Explicit
Private Sub Form_Initialize()
On Error GoTo Proc_Error
DebugLog ">> Sub Form_Initialize() of Form Form1"
' Code
GoTo Proc_Finish
Proc_Error:
DebugLog "Error: " & Err.Number & " on line: " & Erl & vbLf & _
"Description: " & Err.Description & vbLf & _
"in Sub Form_Initialize() of Form Form1", True
Proc_Finish:
DebugLog "<< Sub Form_Initialize() of Form Form1"
On Error GoTo 0
End Sub
Private Sub Form_Load()
On Error GoTo Proc_Error
DebugLog ">> Sub Form_Load() of Form Form1"
' Code
GoTo Proc_Finish
Proc_Error:
DebugLog "Error: " & Err.Number & " on line: " & Erl & vbLf & _
"Description: " & Err.Description & vbLf & _
"in Sub Form_Load() of Form Form1", True
Proc_Finish:
DebugLog "<< Sub Form_Load() of Form Form1"
On Error GoTo 0
End Sub
Private Sub Form_Paint()
On Error GoTo Proc_Error
DebugLog ">> Sub Form_Paint() of Form Form1"
' Code
GoTo Proc_Finish
Proc_Error:
DebugLog "Error: " & Err.Number & " on line: " & Erl & vbLf & _
"Description: " & Err.Description & vbLf & _
"in Sub Form_Paint() of Form Form1", True
Proc_Finish:
DebugLog "<< Sub Form_Paint() of Form Form1"
On Error GoTo 0
End Sub
In a module:
Code:
Public Sub DebugLog(sMessage As String, Optional ByRef bShow As Boolean)
Dim fID As Integer
Dim bPrint As Boolean
Dim aMessage() As String, i As Long
bPrint = Len(g_sErrorLog) > 0
If bPrint Then
On Error Resume Next
fID = FreeFile
Open g_sErrorLog For Append As fID
If InStr(1, sMessage, vbCrLf) > 0 Then
aMessage = Split(sMessage, vbCrLf)
For i = 0 To UBound(aMessage)
Print #fID, Time & " - " & aMessage(i)
Next i
Else
Print #fID, Time & " - " & sMessage
End If
Close #fID
End If
If bShow Then MsgBox sMessage, vbCritical
Debug.Print Timer, sMessage
End Sub
-
Aug 21st, 2017, 10:47 AM
#6
Thread Starter
Fanatic Member
Re: Debug advice needed
@Arnoutdv
I use MZTools to add error templates to the routines.
I don't, but my routine is practically the same.
Except it writes always into a file on the Desktop (which works, I get the output before not loading the main form.)
---
@LaVolpe
Sure, an internal one.
If so, can you send them a test setup without one and starts with main form, not Sub Main.
I'll give that a try.
I will know more tomorrow in the evening then.
Thanks for all your tips.
-
Aug 22nd, 2017, 04:46 AM
#7
Thread Starter
Fanatic Member
Re: Debug advice needed
Found the issue!
Of course it was my fault.
It was a long journey, I had to set up a fresh PC in order to be able to retrace the issue.
Recently I changed the setup script (Inno), and accidently commented out the install of COMCTL32.OCX.
I meant to comment out MSVBM60.DLL.
Now I made a quick Patch installer, and all is good now again.
BUT:
I still wonder why I didn't get a runtime error.
The program was in the task manager, and used some CPU.
Also no real info in the event viewer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|