M
mp
just learning dotnet so i write a lot of debug lines to text file so i can
track where errors occur
Private Sub Logentry(ByVal strMsg As String)
File.AppendAllText("Path to debug file\Debug.txt", strMsg +
Environment.NewLine)
End Sub
the app is a vbnet app running inside autoCad, so it acts like i'm entering
autocad command inside autocad(autocad has focus)
Main app creates worker class that does the work
worker class creates utility class that has general functions used over
various projects
utility class provides logging etc
at end of program run utility class opens the text file to read the debug
log.
in worker class:
Protected Overrides Sub Finalize()
m_acadDoc = Nothing '<----destroy reference to acad document
m_acadApp = Nothing'<----destroy reference to acad application
m_util.OpenDebugLog() '<---ask util class to open debug log file in
notepad
m_util = Nothing'<----destroy reference to utility class
MyBase.Finalize()
End Sub
in the utility class:
Sub OpenDebugLog()
Process.Start(m_DebugFileName)
End Sub
when the file opens in notepad, notepad has focus and keyboard entry goes
into log file.
this didn't use to happen, the file just opened and keyboard focus was still
"in" autocad.
any ideas what i need to do to fix it?
thanks
mark
track where errors occur
Private Sub Logentry(ByVal strMsg As String)
File.AppendAllText("Path to debug file\Debug.txt", strMsg +
Environment.NewLine)
End Sub
the app is a vbnet app running inside autoCad, so it acts like i'm entering
autocad command inside autocad(autocad has focus)
Main app creates worker class that does the work
worker class creates utility class that has general functions used over
various projects
utility class provides logging etc
at end of program run utility class opens the text file to read the debug
log.
in worker class:
Protected Overrides Sub Finalize()
m_acadDoc = Nothing '<----destroy reference to acad document
m_acadApp = Nothing'<----destroy reference to acad application
m_util.OpenDebugLog() '<---ask util class to open debug log file in
notepad
m_util = Nothing'<----destroy reference to utility class
MyBase.Finalize()
End Sub
in the utility class:
Sub OpenDebugLog()
Process.Start(m_DebugFileName)
End Sub
when the file opens in notepad, notepad has focus and keyboard entry goes
into log file.
this didn't use to happen, the file just opened and keyboard focus was still
"in" autocad.
any ideas what i need to do to fix it?
thanks
mark