Board index » cppbuilder » The annoying exception "Index Out of Bound" under MS Terminal servicve server.

The annoying exception "Index Out of Bound" under MS Terminal servicve server.


2005-02-21 03:55:45 PM
cppbuilder21
Hi all, I encount an annoying problem.
My report program is based on C++ builder 4.0 (a rather old product). The
program employs TThread to create a report file in backgroud.
It works well when runs in normal mode (or console mode in term of terminal
service). However, an exception of "List Index Out of Bound" will be thrown
when runs in the context of terminal server of microsoft.
The occurence time of this exception is uncertain, and the index which is
out of the bound is also uncertain, this time is 2, and next time may be 10.
Are there anyone can help me ? Thanks!
Alex
 
 

Re:The annoying exception "Index Out of Bound" under MS Terminal servicve server.

Hi!
alex yuan wrote:
Quote
My report program is based on C++ builder 4.0 (a rather old product). The
program employs TThread to create a report file in backgroud.
[snip]
The occurence time of this exception is uncertain, and the index which is
out of the bound is also uncertain, this time is 2, and next time may be 10.

Are there anyone can help me ? Thanks!
Sounds like a race condition. Debugging this is a nightmare.
Chances are your program is buggy, but the bug does not show when
the program is run "normally".
You should check for unsynchonized access from the thread to
the form and vice versa.
Frank