Re: GPF in EbLoadRunTime while loading MDI Form
From: Ken Halter (Ken_Halter_at_Use_Sparingly_Hotmail.com)
Date: 12/17/04
- Next message: penguin: "Re: Changing paper size in VB6"
- Previous message: DJThompson: "RE: App.Path in Class_Initialize (or MS VB runtime threading bug)"
- In reply to: 24601: "GPF in EbLoadRunTime while loading MDI Form"
- Next in thread: 24601: "Re: GPF in EbLoadRunTime while loading MDI Form"
- Reply: 24601: "Re: GPF in EbLoadRunTime while loading MDI Form"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 17 Dec 2004 07:43:00 -0800
"24601" <24601@discussions.microsoft.com> wrote in message
news:F9D29D0D-730C-4C53-AD66-D33F2F253A80@microsoft.com...
> Hello everybody,
>
> on a NT machine my program is producing a GPF during the load event of
> an
> MDI form. Here's the log from Dr. Watson:
>
Dr Watson rarely helps debug VB programs. You might want to start a new
project, add a new MDI form and a few child forms and see if it's a "system
wide" problem or just that specific project. If it's only that project, add
some logging to MDIForm_Load
Here's my Debug.Print 2 File code. Using this, you'll get a log file in
App.Path. Usage is the same as Debug.Print (without the period)
'================
Option Explicit
Private Sub Form_Load()
DebugPrint "This is a test", Timer
DebugPrint "This is another test", Timer
End Sub
Private Sub DebugPrint(ParamArray LogData())
'You set this stuff up.
Const LOG_2_FILE As Boolean = True
Const LOG_2_SCREEN As Boolean = True
Const OVER_WRITE_FIRST As Boolean = True
Static bBeenHereB4 As Boolean
Dim i As Integer
Dim iFile As Integer
Dim bOverWriteNow As Boolean
Dim sLogFilePath As String
On Error GoTo ErrorTrap
If LOG_2_FILE Then
If Not bBeenHereB4 Then
bOverWriteNow = OVER_WRITE_FIRST
End If
iFile = FreeFile
sLogFilePath = App.Path
sLogFilePath = sLogFilePath _
& IIf(Right$(sLogFilePath, 1) = "\", "", "\") & "DebugLog.txt"
If bOverWriteNow Then
'Overwrite file if first time here
Open sLogFilePath For Output As iFile
Else
'Open file
Open sLogFilePath For Append As iFile
End If
End If
For i = 0 To UBound(LogData)
If LOG_2_SCREEN Then
Debug.Print LogData(i),
End If
If LOG_2_FILE Then
Print #iFile, LogData(i),
End If
Next
If LOG_2_SCREEN Then
Debug.Print 'End of line
End If
If LOG_2_FILE Then
Print #iFile, "" 'End of line
Close iFile
End If
bBeenHereB4 = True
Terminate:
Exit Sub
ErrorTrap:
'Just show a message box for this sample
MsgBox "Error " & Err.Number _
& vbCrLf & Err.Description, vbCritical
Resume Terminate
End Sub
'================
-- Ken Halter - MS-MVP-VB - http://www.vbsight.com Please keep all discussions in the groups..
- Next message: penguin: "Re: Changing paper size in VB6"
- Previous message: DJThompson: "RE: App.Path in Class_Initialize (or MS VB runtime threading bug)"
- In reply to: 24601: "GPF in EbLoadRunTime while loading MDI Form"
- Next in thread: 24601: "Re: GPF in EbLoadRunTime while loading MDI Form"
- Reply: 24601: "Re: GPF in EbLoadRunTime while loading MDI Form"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|