Try replacing App.DoEvents with App.SleepCurrentThread 100 or so and
see if that fixes things.
Charles Yeomans
On Sep 19, 2006, at 5:12 PM, Tim Jones wrote:
On Sep 19, 2006, at 2:03 PM, Charles Yeomans wrote:
Is this in a console app? If not, I'd suspect the call to
App.DoEvents.
Hi Charles,
It's a GUI app.
Good point and I'd already though of that. But, this begs the
question of just how deep that stack is. However. since the
App.DoEvents() is only called on the very last output from the
shell, there shouldn't be an issue as this runs successfully on
shorter runs and is totally unpredictable on the long runs (20
minutes on the first, 2:12 on the second test).
Thanks,
Tim
--
Tim Jones [EMAIL PROTECTED]
Charles Yeomans
On Sep 19, 2006, at 4:54 PM, Tim Jones wrote:
Hi Folks,
Does anyone have a tried and true mechanism for monitoring for
and either fixing or preventing a StackOverflow exception? I'm
monitoring a processing a very long shell process (could be
days), and after unexpected periods the shell's DataAvailable
event throws a StackOverflow exception. The exception is thrown
at the entry to the DataAvailable event.
Here's my code from the DataAvailable event:
------------------------------
Dim x, y, err, mTop As integer
// mBuffer and runData are parent global variables
// thMon2 is the monitor thread for taking the runData and
updating the interface
x = 0
Self.mBuffer = Self.mBuffer + ConvertEncoding(Me.ReadAll,
Encodings.UTF8)
If InStr(self.mBuffer, "[I") <> 0 _
Or InStr(self.mBuffer, "[A") <> 0 _
Or InStr(self.mBuffer, "[Q") <> 0 Then
Debug.Print self.mBuffer
ProcAll = True // We caught a Volume completion message, so
process ALL data
End If
Self.runData = Split(Self.mBuffer, EndOfLine)
If Not ProcAll Then
// take the last line and return it to the mBuffer so the
next ReadAll() completes
// a potentially incomplete line (thanks, Joe!).
Self.mBuffer = Self.runData.Pop
End If
// Process the result
If Self.thMon2.State <> Thread.Running Then
Self.thMon2.Run
ElseIf ProcAll Then
// wait for the current thread loop to complete
While Self.thMon2.State = Thread.Running
App.DoEvents(25)
Wend
Self.thMon2.Run
End If
ProcAll = False
---------------------------------
Am I missing something? This occurs in the built Mach-O
application and in the debugger run.
Tim
--
Tim Jones [EMAIL PROTECTED]
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>