From: mp on
Hi,
I'm using a utility class to provide debugging notes during program run to
see where things are happening.

....in class Util.vb.....
Public Sub Logentry(ByVal strMsg As String)
If m_Debug Then
File.AppendAllText(m_DebugFileName, strMsg + Environment.NewLine)
End If
End Sub

Sub OpenDebugLog()
Process.Start(m_DebugFileName)
End Sub
..............................


then in program
call logentry at points of interest...
at end of program call OpenDebugLog

....in file program.vb...
Protected Overrides Sub Finalize()
m_util.OpenDebugLog()
m_util = Nothing
MyBase.Finalize()
End Sub

..... this works sort of, but has the following problems
1) recently there is a long delay after the program has actually quit before
the text file is opened (in notepad)
i don't remember it having such a delay previously..(probably changed
something but dont' know what)

2) when the notepad opens it steals focus from the app in which my little
program was running (autocad)
so when a moment before keyboard entry was going to autocad (to start my
program and respond to prompts) and then when the notepad comes up with the
debug log all of a sudden keystrokes are going to notepad instead of
autocad.

I recal someone in a post long ago said that I shouldn't be using Overrides
Sub Finalize()
I don't recall the details and don't understand the overrides anyway as i
just copied it from another code base trying to make this one (learn by
doing - er make that copying and editing)
:-)

any help?
thanks
mark