Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Win 32 Controls/TListView    [ Add a report in this area ]  
Report #:  78788   Status: Closed
EReadError when compiling TListView with no data items.
Project:  Delphi Build #:  2010, XE
Version:    15.0 Submitted By:   jeremy grand
Report Type:  Basic functionality failure Date Reported:  10/19/2009 9:41:19 AM
Severity:    Serious / Highly visible problem Last Updated: 5/16/2012 9:20:37 PM
Platform:    All platforms Internal Tracking #:  
Resolution: Duplicate (Resolution Comments) Resolved in Build: : XE2
Duplicate of:  89148
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Converting a D7 pro app to D2010 enterprise.

Form has TListView in report view. Press F to compile.  Error message is that there is a stream read error reading Items.itemData. The item list is empty, and is filled at run time.  I added a phony item & that seemed to fix the problem,  but a different TListview had this issue.
  
Removing the phony item causes the problem to recur. TListView apparently requires at least one item to load reliably.  BTW, I use reportview in all cases.

Steps to Reproduce:
See Description.

Added by Sysop
<<<<
See attached screenshot for more details.
>>>>
Workarounds
Add at least one data item to TListView at design time.
Attachment
Delphi problem 78788.ZIP
Comments

Tomohiro Takahashi at 10/19/2009 6:24:23 PM -
Could you please attach sample project to reproduce your issue?

jeremy grand at 10/26/2009 3:56:58 PM -
I reduced the app to about 800 lines of code, and the error
continued to happen. I removed all units except the main form.  Here's a curious thing, though.  The original app has a datamodule. When I removed that from the project and deleted the related files, I was prompted to remove direct and indirect links to the dm, and I said No. The app compiled, and continued to have the same error.  Then I did
ctrl-S to save and got the message again about removing links.  This time I said Yes.  Now the app compiles and runs without the stream read error.

The problem may have gone away.  I did the obvious -- in the original app, I closed my main form, then was able to switch the data module to text view. Ctrl-S, then compile and run.  I compiled and ran many times without a problem.  Switched back to form view, compiled and ran many times without an issue.

This is a pretty old app and the dm has been around a very long time. I suppose that the problem was some kind of minor corruption in the file that was cleared by viewing as text.

Jon Robertson at 2/15/2010 11:46:12 AM -
We have this problem in a D6 project updated to D2009.

The stream read error will occur at both design-time and at run-time, when trying to open/create the form.

When the stream read error occurs, the .DFM contains the line:

Items.ItemData = {}

If we remove this line from the .DFM, the form will open without error, at either design-time or run-time.

We've seen this problem with TListView, TRzListView, and TdfsExtListView, all of which derive from TCustomListView.

We use form inheritance, and that may play a factor.

I'm going to try to create a test case using a new D6 project and upgrading it to D2009.  If I'm successful, I'll attach it to this QC.

Tomohiro Takahashi at 2/15/2010 4:52:44 PM -
> I'm going to try to create a test case using a new D6 project and
>  upgrading it to D2009.  If I'm successful, I'll attach it to this QC.
Thanks for the information. If you attach it, please reply to this comment. I will check it out ASAP.

Gary Freestone at 6/19/2011 10:05:58 PM -
Any progress on this issue.  Its coming up to 2 years since this was created and I now have the issue with Delphi XE.

Tomohiro Takahashi at 6/19/2011 10:28:16 PM -
Hi, Gary-san
Do you have any sample project and [Steps] to confirm this issue?
If yes, could you please upload it to Discussion Forum?
[Embarcadero Discussion Forums >> Attachments]
https://forums.embarcadero.com/forum.jspa?forumID=2

Gary Freestone at 7/7/2011 6:43:49 PM -
Takahashi san,

I can't reproduce this problem "on demand".  It seems to be random.   Anecdotally however it seems to be when Delphi has been up and running for a long time (3-4 days or more).  Then during a compile I get the error.  

Most times if I shutdown and restart Delphi the error goes away for a few more days. But not always, sometime it requires a restart of windows.

Is there anything I can run/do to gather more information when the problem occurs to get you more information ?

Gary

Tomohiro Takahashi at 7/7/2011 7:00:40 PM -
Do you have any scrrenshot to confirm the error?

Gary Freestone at 7/11/2011 4:40:49 PM -
Takahashi-san,

Where/how do I load up a file to QC ?  

Gary

Tomohiro Takahashi at 7/11/2011 7:29:05 PM -
Gary-san
Could you please upload it to Discussion Forum?  I will attach it to this report.
[Embarcadero Discussion Forums >> Attachments]
https://forums.embarcadero.com/forum.jspa?forumID=2

Gary Freestone at 8/18/2011 6:35:46 PM -
Screen shots have been uploaded

Tomohiro Takahashi at 8/18/2011 7:00:37 PM -
Gary-san
Is this issue same as QC#89148 ?

QC#89148 is fixed with next version of Delphi...
If you a Fieldtester of it, please retest your issue with the beta release...

Tomohiro Takahashi at 8/21/2011 4:25:04 AM -
jereny-san
Is this issue same as QC#89148 ?

Marcus Fuchs at 1/18/2012 6:45:47 AM -
Yes, I think it's a duplicate of #89148. But would be nice to get a fix for Delphi XE (not just XE2).

Server Response from: ETNACODE01