|
-
March 24th, 2008, 10:20 PM
#1
[RESOLVED] Is there a VB6 compiler cache?
I've run into a perplexing problem. I have a program that runs fine in the debugger, but throws a subscript error when compiled. This is the procedure that errors:
Code:
Private Sub ConfigureHeaders()
Dim lTemp As Long, lWidth As Long
On Error GoTo ErrHand
lstAudit.ListItems.Clear
lstAudit.ColumnHeaders.Clear
For lTemp = LBound(csCols) To UBound(csCols)
lWidth = goOptions.GetAuditColumns(lTemp)
If lWidth < 0 Then lWidth = DEFAULT_COL_WIDTH
Call lstAudit.ColumnHeaders.Add(lTemp + 1, , csCols(lTemp), lWidth)
If lTemp = NUM_AUDIT_COLS Then Exit For
Next lTemp
ErrHand:
If Err.Number <> 0 Then
Call MsgBox("Error number " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
"in routine ConfigureHeaders of AuditTray", vbExclamation, "TrialTrack Error")
End If
End Sub
The error seems to happen when the UBound function is called, in fact, this code will hang the program when compiled (but strangely won't throw the subscript error).
Code:
Private Sub ConfigureHeaders()
Dim lTemp As Long, lWidth As Long
On Error GoTo ErrHand
MsgBox (UBound(csCols))
lstAudit.ListItems.Clear
lstAudit.ColumnHeaders.Clear
For lTemp = LBound(csCols) To UBound(csCols)
lWidth = goOptions.GetAuditColumns(lTemp)
If lWidth < 0 Then lWidth = DEFAULT_COL_WIDTH
Call lstAudit.ColumnHeaders.Add(lTemp + 1, , csCols(lTemp), lWidth)
If lTemp = NUM_AUDIT_COLS Then Exit For
Next lTemp
ErrHand:
If Err.Number <> 0 Then
Call MsgBox("Error number " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
"in routine ConfigureHeaders of AuditTray", vbExclamation, "TrialTrack Error")
End If
End Sub
It seems almost like the array isn't getting initialized properly in the compiled version. As I've been playing around with this to try to get it to compile correctly, I've also noticed that the executable size always stays the same, even when I comment out huge swaths of code. That makes me suspect that the compiler is caching object files someplace and isn't updating them before linking. This is driving me absolutely batty. Anyone ever run into a similar problem or have an idea how to fix it? I've tried turning all the compiler optimizations off, renaming functions and variables (last time something like this happened it was an alias error in the compiler), deleting the .frx file for the form, removing the .frm file and rebuilding it, etc., etc.
Last edited by Comintern; March 24th, 2008 at 10:24 PM.
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
|