<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Ross<br>
<br>
Clearly the problem is NOT that the items are being removed from the
list. Rather the items are being freed, (from previous comments) in
various places, yet not removed. <br>
<br>
Just because <span style="font-family:
"Calibri","sans-serif"; color: black;">assigned(PlayView.Items[i])
is true, does not mean that that instance exists. It means that
the object pointer is not nil. Do you understand the difference
between a nil pointer and a pointer to memory that is no longer in
use?<br>
<br>
Todd.<br>
<br>
<br>
</span>
<blockquote cite="mid:00e501ce35dd$ddac6370$99052a50$@com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 3 0 0 0 0 0 0 0;}
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 3 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@PMingLiU";
        panose-1:2 2 3 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">I’ve heard today that TeamViewer isn’t in use
when the problem occurs. They often use it to resolve the
issue after the problem has occurred.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">They tell me they have seen it in mid-song where
all the tracks disappear and the app then becomes
unresponsive or crashes because of the app still accessing
items that don’t exist.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">There are no deletion routines in the program
which delete every item from the listview, so that’s not
what’s going on. Considering there are around 5000 users
who have no problems at all, I don’t think it can be a
coding problem. There has been the very rare issue like
this reported over the years but this one user is getting it
regularly, like every couple of days.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">I thought I was on to something with remote
control app but it appears not. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">Another reported crash a couple of weeks ago was
here…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: black;">i
:= Item.Index;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: black;">while
(i < PlayView.Items.Count) and (PlayView.Items[i].Caption
= EventTimeStr) do<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">The “while” line crashed with Access Violation in
ComCtrls.TListItems.GetItem, and the screen shot again
showed no items. This should prove that it cannot be the
software removing the items as otherwise Items.Count would
be 0.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">Someone else with dual monitors had a crash on
the same line about 6 months ago and it has now been
modified to validate items[i] is a real item before
retrieving the caption. This will stop the error but the
software will not function correctly.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">Cheers.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<div>
<div style="border-right: medium none; border-width: 1pt
medium medium; border-style: solid none none; border-color:
rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;
padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family:
"Tahoma","sans-serif";"
lang="EN-US">From:</span></b><span style="font-size:
10pt; font-family:
"Tahoma","sans-serif";" lang="EN-US">
<a class="moz-txt-link-abbreviated" href="mailto:delphi-bounces@listserver.123.net.nz">delphi-bounces@listserver.123.net.nz</a>
[<a class="moz-txt-link-freetext" href="mailto:delphi-bounces@listserver.123.net.nz">mailto:delphi-bounces@listserver.123.net.nz</a>] <b>On
Behalf Of </b>Ross Levis<br>
<b>Sent:</b> Wednesday, 10 April 2013 2:38 a.m.<br>
<b>To:</b> 'NZ Borland Developers Group - Delphi List'<br>
<b>Subject:</b> Re: [DUG] TListitems disappearing and
reappearing causing access violations<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);">I guess I am. It makes the most sense. I’ll
have to try a test with TeamViewer to duplicate it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:
"Calibri","sans-serif"; color: rgb(31,
73, 125);"><o:p> </o:p></span></p>
<div style="border-right: medium none; border-width: 1pt medium
medium; border-style: solid none none; border-color: rgb(181,
196, 223) -moz-use-text-color -moz-use-text-color; padding:
3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family: "Tahoma","sans-serif";"
lang="EN-US">From:</span></b><span style="font-size:
10pt; font-family:
"Tahoma","sans-serif";" lang="EN-US">
<a moz-do-not-send="true"
href="mailto:delphi-bounces@listserver.123.net.nz">delphi-bounces@listserver.123.net.nz</a>
[<a moz-do-not-send="true"
href="mailto:delphi-bounces@listserver.123.net.nz">mailto:delphi-bounces@listserver.123.net.nz</a>]
<b>On Behalf Of </b>Kyley Harris<br>
<b>Sent:</b> Wednesday, 10 April 2013 12:48 a.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> Re: [DUG] TListitems disappearing and
reappearing causing access violations<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom: 12pt;">I think
the problem is that right now you are running on the
Theory that they are being reconstructed as you state, and
you have not created a test scenario to validate what you
are saying. <o:p></o:p></p>
</div>
<p class="MsoNormal">it could just be a coding error, and the
delete event will tell you when a list item is being
destroyed. That list item will not be destroyed if the
window handle is reconstructed. Not in the source code I can
see.,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom: 12pt;"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Apr 10, 2013 at 12:41 AM, Ross
Levis <<a moz-do-not-send="true"
href="mailto:ross@stationplaylist.com" target="_blank">ross@stationplaylist.com</a>>
wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style=""><span style="font-family:
"Calibri","sans-serif"; color:
rgb(31, 73, 125);">Actually that doesn’t help so
much. I really need to know when Windows is
deleting the items. My app also deletes items. I
guess I could remove the OnDeletion event property
before coding a delete and reinstate if afterwards.
A little messy.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span style="font-family:
"Calibri","sans-serif"; color:
rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span style="font-family:
"Calibri","sans-serif"; color:
rgb(31, 73, 125);">I really need to associate the
individual deleted items with the identical new
items that will be created just afterwards. Ideally
I would want my app to stop processing all timers
and functions while the deletions and recreations
are done.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span style="font-family:
"Calibri","sans-serif"; color:
rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span style="font-family:
"Calibri","sans-serif"; color:
rgb(31, 73, 125);">Getting too complicated.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span style="font-family:
"Calibri","sans-serif"; color:
rgb(31, 73, 125);"> </span><o:p></o:p></p>
<div style="border-right: medium none; border-width: 1pt
medium medium; border-style: solid none none;
border-color: rgb(181, 196, 223) -moz-use-text-color
-moz-use-text-color; padding: 3pt 0cm 0cm;">
<p class="MsoNormal" style=""><b><span
style="font-size: 10pt; font-family:
"Tahoma","sans-serif";"
lang="EN-US">From:</span></b><span
style="font-size: 10pt; font-family:
"Tahoma","sans-serif";"
lang="EN-US"> <a moz-do-not-send="true"
href="mailto:delphi-bounces@listserver.123.net.nz"
target="_blank">delphi-bounces@listserver.123.net.nz</a>
[mailto:<a moz-do-not-send="true"
href="mailto:delphi-bounces@listserver.123.net.nz"
target="_blank">delphi-bounces@listserver.123.net.nz</a>]
<b>On Behalf Of </b>Kyley Harris</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
<b>Sent:</b> Wednesday, 10 April 2013 12:06 a.m.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><b>To:</b> NZ Borland
Developers Group - Delphi List<br>
<b>Subject:</b> Re: [DUG] TListitems
disappearing and reappearing causing access
violations<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style=""> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="">the listview has an
Ondeletion event. when that fires, you should
check the index, and remove any listitem
references from your tlist. <br>
<br>
The issue seems to be that you are mixing view
objects with data objects. the system might go
more smoothly if you were containing your data
objects disctinct from your view (tlistview) and
synchronizing the view to the source. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom: 12pt;"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="">On Tue, Apr 9,
2013 at 11:58 PM, Ross Levis <<a
moz-do-not-send="true"
href="mailto:ross@stationplaylist.com"
target="_blank">ross@stationplaylist.com</a>>
wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">It isn’t a
user initiated procedure. It’s a
broadcast media player in automation
mode and each track is a listitem.
Items can be dropped off the top and
more added to the bottom as it plays
automated.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">There is a
TTimer which accesses all the items in
the list once a second to provide totals
and such. So the items are accessed
very regularly.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">Some of the
list items are timed events which need
to occur at a specific time. These item
pointers are stored in a TList so the
software can easily access the next one
without having to look for it in the
list.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">This user has
had issues with the code that accesses
this TList of TListitem pointers, so
that sounds like the pointers to the
listitems have been changed.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">Ideally the
listitems shouldn’t be accessed directly
and a separate data store should be used
that is linked to each item via the Data
property. A bit too late for that now
though.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">So it sounds
like I need to find the Windows message
that is being sent to the app to
recreate windows and do some
housekeeping.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">Any ideas what
that might be?</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<div style="border-right: medium none;
border-width: 1pt medium medium;
border-style: solid none none;
border-color: rgb(181, 196, 223)
-moz-use-text-color -moz-use-text-color;
padding: 3pt 0cm 0cm;">
<p class="MsoNormal" style=""><b><span
style="font-size: 10pt; font-family:
"Tahoma","sans-serif";" lang="EN-US">From:</span></b><span
style="font-size: 10pt; font-family:
"Tahoma","sans-serif";"
lang="EN-US"> <a
moz-do-not-send="true"
href="mailto:delphi-bounces@listserver.123.net.nz"
target="_blank">delphi-bounces@listserver.123.net.nz</a>
[mailto:<a moz-do-not-send="true"
href="mailto:delphi-bounces@listserver.123.net.nz"
target="_blank">delphi-bounces@listserver.123.net.nz</a>]
<b>On Behalf Of </b>Kyley Harris<br>
<b>Sent:</b> Tuesday, 9 April 2013
11:35 p.m.</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style=""><br>
<b>To:</b> NZ Borland Developers
Group - Delphi List<br>
<b>Subject:</b> Re: [DUG] TListitems
disappearing and reappearing causing
access violations<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style=""> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"
style="margin-bottom: 12pt;">If
that was the case.. then its
unlikely to happen midstream
during a very small short
procedure call. Especially if that
procedure call is a user initiated
one. <o:p></o:p></p>
</div>
<p class="MsoNormal" style="">if that
is the case.. its extremely simple
to test this with remote desktop and
some logging of the
construction/destruction of the list
items.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="margin-bottom: 12pt;"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="">On
Tue, Apr 9, 2013 at 11:29 PM, Ross
Levis <<a
moz-do-not-send="true"
href="mailto:ross@stationplaylist.com"
target="_blank">ross@stationplaylist.com</a>>
wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">I’ve
had someone suggest this
elsewhere…</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><i><span
style="font-family:
"Calibri","sans-serif";">The
user connects a monitor to
a laptop, or connects
remotely via <br>
terminal services.<br>
Basically, anything that
changes the display
resolution has that kind
of <br>
consequences.</span></i><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">I
have seen a TeamViewer in
one of the many screen
shots. So I guess Windows
is recreating the windows
and allocating new handles
to the list items as I
thought. I’ll check with
them if the crashes coincide
with use of TeamViewer.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">Ross.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<div>
<div style="border-right:
medium none; border-width:
1pt medium medium;
border-style: solid none
none; border-color: rgb(181,
196, 223)
-moz-use-text-color
-moz-use-text-color;
padding: 3pt 0cm 0cm;">
<p class="MsoNormal"
style=""><b><span
style="font-size:
10pt; font-family:
"Tahoma","sans-serif";"
lang="EN-US">From:</span></b><span
style="font-size: 10pt;
font-family:
"Tahoma","sans-serif";"
lang="EN-US"> Ross Levis
[mailto:<a
moz-do-not-send="true"
href="mailto:ross@stationplaylist.com" target="_blank">ross@stationplaylist.com</a>]
<br>
<b>Sent:</b> Tuesday, 9
April 2013 11:17 p.m.<br>
<b>To:</b> 'NZ Borland
Developers Group -
Delphi List'<br>
<b>Subject:</b> RE:
[DUG] TListitems
disappearing and
reappearing causing
access violations</span><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style=""> <o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">The
list is populated by the
software. It’s still in
Delphi 7.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">No
threads are deleting any
items. Only the main
thread adds and removes
items.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">There
is no one procedure this
has occurred in. It can
work for 2 days and
suddenly this happens in a
random procedure that
accesses a list item.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">In
this particular case, it
is in a procedure where
one specific listitem is
sent as a parameter.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">Here
are some of the relevant
lines of code in the
procedure being executed.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">
if Item <> nil then</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">
begin</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> if
Item.Selected then
UpdateButtons;</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">
…</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> Item.ImageIndex
:= 8;</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">
end;</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">There
are no deletions in the
procedure.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">The
Item.Selected test works
fine but Item.ImageIndex
:= 8 crashes at
TListItem.SetImage with an
access violation.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">The
item existed and then no
items exist based on the
screen shot.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">I’ve
been having to put
validations all over the
place like this…</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">if
ListView.Items.IndexOf(Item)
>= 0 then
Listitem.ImageIndex := 8.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">This
user has had a crash where
it does this validation up
the procedure somewhere
which validated, but
further down it will be
accessing Item.Index and
this crashes.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">It’s
a nightmare. I’m
wondering if it could be
corrupt RAM in the PC or
something.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">Cheers,</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);">Ross.</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span
style="font-family:
"Calibri","sans-serif";
color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<div style="border-right:
medium none; border-width:
1pt medium medium;
border-style: solid none
none; border-color: rgb(181,
196, 223)
-moz-use-text-color
-moz-use-text-color;
padding: 3pt 0cm 0cm;">
<p class="MsoNormal"
style=""><b><span
style="font-size:
10pt; font-family:
"Tahoma","sans-serif";"
lang="EN-US">From:</span></b><span
style="font-size: 10pt;
font-family:
"Tahoma","sans-serif";"
lang="EN-US"> <a
moz-do-not-send="true"
href="mailto:delphi-bounces@listserver.123.net.nz" target="_blank">delphi-bounces@listserver.123.net.nz</a>
[<a
moz-do-not-send="true"
href="mailto:delphi-bounces@listserver.123.net.nz" target="_blank">mailto:delphi-bounces@listserver.123.net.nz</a>]
<b>On Behalf Of </b>Kyley
Harris<br>
<b>Sent:</b> Tuesday, 9
April 2013 10:33 p.m.<br>
<b>To:</b> NZ Borland
Developers Group -
Delphi List<br>
<b>Subject:</b> Re:
[DUG] TListitems
disappearing and
reappearing causing
access violations</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style=""> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"
style="margin-bottom:
12pt;">without seeing
the 10lines above, and
whats inbetween (if
you were being
literal) its very hard
to say. <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"
style="margin-bottom:
12pt;">The only time
I've ever had
something dissapear
from a list is when
I deleted it though
a callback, method,
thread etc.. or
freeing something. <o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal"
style="margin-bottom:
12pt;">what version of
delphi is the code
now? How does the list
get populated or
edited by the
application.. <o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal"
style="">I'd start by
looking at how many
locations of code insert
or delete the list
items, and verify none
are being called while
your procedure is
executing its for-loop,
(assuming the access
violation is an index
based one because of the
list count change)<o:p></o:p></p>
<div>
<p class="MsoNormal"
style="margin-bottom:
12pt;"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"
style="margin-bottom:
12pt;"> <o:p></o:p></p>
<div>
<p class="MsoNormal"
style="">On Tue, Apr
9, 2013 at 10:21 PM,
Ross Levis <<a
moz-do-not-send="true"
href="mailto:ross@stationplaylist.com" target="_blank">ross@stationplaylist.com</a>>
wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);">Wondering
if anyone has
any ideas.</span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);"> </span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);">I've had
this problem a
long time from
when I started
writing an app
about 7 or 8
years ago, but
it happens so
rarely it's not
usually an
issue. But one
user in
particularly is
regularly
sending me
MadExcept
reports which
either have
access violation
errors or "the
application
appears to be
frozen". In all
cases it's
during an access
of a TListItem
which was
perfectly valid
10 lines of code
up a procedure
but suddenly
doesn't exist.</span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);"> </span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);">The
screenshot
created at the
same time shows
the ListView has
no visible
items, but I
know for a fact
there are 30 or
more items in
the list. I
believe
sometimes the
items visually
disappear and
reappear shortly
afterwards, like
a Desktop
refresh.</span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);"> </span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);">I think
I've heard
something about
Windows
recreating the
window handles
or some such
thing. I don't
understand why
it would do so.
There are no
changes to the
listview that
would require
re-creating the
window.</span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);"> </span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);">Any
ideas?</span><o:p></o:p></p>
<p class="MsoNormal"
style=""><span
style="color:
rgb(31, 73,
125);"> </span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"
style=""><br>
_______________________________________________<br>
NZ Borland Developers
Group - Delphi mailing
list<br>
Post: <a
moz-do-not-send="true"
href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>
Admin: <a
moz-do-not-send="true"
href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an
email to <a
moz-do-not-send="true"
href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a>
with Subject:
unsubscribe<o:p></o:p></p>
</div>
<p class="MsoNormal"
style=""><br>
<br clear="all">
<br>
-- <br>
Kyley Harris<br>
Harris Software<br>
+64-21-671-821 <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style=""><br>
_______________________________________________<br>
NZ Borland Developers Group -
Delphi mailing list<br>
Post: <a moz-do-not-send="true"
href="mailto:delphi@listserver.123.net.nz"
target="_blank">delphi@listserver.123.net.nz</a><br>
Admin: <a moz-do-not-send="true"
href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a
moz-do-not-send="true"
href="mailto:delphi-request@listserver.123.net.nz"
target="_blank">delphi-request@listserver.123.net.nz</a>
with Subject: unsubscribe<o:p></o:p></p>
</div>
<p class="MsoNormal" style=""><br>
<br clear="all">
<br>
-- <br>
Kyley Harris<br>
Harris Software<br>
+64-21-671-821 <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style=""><br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing
list<br>
Post: <a moz-do-not-send="true"
href="mailto:delphi@listserver.123.net.nz"
target="_blank">delphi@listserver.123.net.nz</a><br>
Admin: <a moz-do-not-send="true"
href="http://delphi.org.nz/mailman/listinfo/delphi"
target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a
moz-do-not-send="true"
href="mailto:delphi-request@listserver.123.net.nz"
target="_blank">delphi-request@listserver.123.net.nz</a>
with Subject: unsubscribe<o:p></o:p></p>
</div>
<p class="MsoNormal" style=""><br>
<br clear="all">
<br>
-- <br>
Kyley Harris<br>
Harris Software<br>
+64-21-671-821 <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a moz-do-not-send="true"
href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a moz-do-not-send="true"
href="http://delphi.org.nz/mailman/listinfo/delphi"
target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a moz-do-not-send="true"
href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a>
with Subject: unsubscribe<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <br>
Kyley Harris<br>
Harris Software<br>
+64-21-671-821 <o:p></o:p></p>
</div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a class="moz-txt-link-abbreviated" href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a>
Admin: <a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<i>Fortune</i> favours the <b>brave</b></div>
</body>
</html>