Hi folks!
Look at the code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace LstView
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader ch1;
private System.Windows.Forms.ColumnHeader ch2;
private System.Windows.Forms.ColumnHeader ch3;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
InitListView();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.listView1 = new System.Windows.Forms.ListView();
this.ch1 = new System.Windows.Forms.ColumnHeader();
this.ch2 = new System.Windows.Forms.ColumnHeader();
this.ch3 = new System.Windows.Forms.ColumnHeader();
this.SuspendLayout();
//
// listView1
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.ch1,
this.ch2,
this.ch3});
this.listView1.HeaderStyle =
System.Windows.Forms.ColumnHeaderStyle.Nonclickabl e;
this.listView1.Location = new System.Drawing.Point(16, 24);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.listView1.Size = new System.Drawing.Size(256, 224);
this.listView1.TabIndex = 0;
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new
System.EventHandler(this.listView1_SelectedIndexCh anged);
//
// ch1
//
this.ch1.Text = "ch1";
//
// ch2
//
this.ch2.Text = "ch2";
//
// ch3
//
this.ch3.Text = "ch3";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.listView1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitListView()
{
string [] item1=new string[3];
item1[0]="start";
item1[1]="end";
item1[2]="free";
ListViewItem lvi = new ListViewItem(item1);
listView1.Items.Add(lvi);
}
private void listView1_SelectedIndexChanged(object sender, System.EventArgs
e)
{
foreach(ListViewItem lvi in listView1.ListViewItemCollection)
{
}
}
}
}
I know that listView1 have Items property of type ListViewItemCollection,
but if I by mistake wrote ListViewItemCollection why compiler should stuck? 8 1198
Hi Boris,
ListViewItemCollection is a class declared inside ListView, it's not a
property of ListView, if you want to get the items in the ListView you have
to use ListView.Items that is an instance of ListViewItemCollection.
Your for loop will looks like:
foreach(ListViewItem lvi in listView1.Items)
{
}
Hope this help,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Yes, I agree with You completely. But am I wrong by asking from compiler to
be more precice and not to fail with internal compiler error. Try to compile
code that I passed.
:)
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:e4**************@TK2MSFTNGP09.phx.gbl... Hi Boris,
ListViewItemCollection is a class declared inside ListView, it's not a property of ListView, if you want to get the items in the ListView you
have to use ListView.Items that is an instance of ListViewItemCollection. Your for loop will looks like: foreach(ListViewItem lvi in listView1.Items) { }
Hope this help,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
Yes, it fails with "internal compiler error". Looks like it is problem
inside the compiler. At least it gives you the nearest point where to look
for an error.
--
B\rgds
100
"Boris" <ic*****@hotmail.com> wrote in message
news:O4**************@tk2msftngp13.phx.gbl... Yes, I agree with You completely. But am I wrong by asking from compiler
to be more precice and not to fail with internal compiler error. Try to
compile code that I passed. :)
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:e4**************@TK2MSFTNGP09.phx.gbl... Hi Boris,
ListViewItemCollection is a class declared inside ListView, it's not a property of ListView, if you want to get the items in the ListView you have to use ListView.Items that is an instance of ListViewItemCollection. Your for loop will looks like: foreach(ListViewItem lvi in listView1.Items) { }
Hope this help,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
Hi,
Indeed it's a compiler bug, when I try to compile the code it gives me
"Internal Compiler Error: stage 'COMPILE' among others.
I think that MS should get a report of this.
Also the IDE gets screw up, from that moment all the files in the projects
lost the colors for the reserved words and the autocomplete does not work,
it's only after the delete the code and recompile that all return to nornal.
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:ew**************@TK2MSFTNGP10.phx.gbl... Yes, it fails with "internal compiler error". Looks like it is problem inside the compiler. At least it gives you the nearest point where to look for an error.
-- B\rgds 100
"Boris" <ic*****@hotmail.com> wrote in message news:O4**************@tk2msftngp13.phx.gbl... Yes, I agree with You completely. But am I wrong by asking from compiler to be more precice and not to fail with internal compiler error. Try to compile code that I passed. :)
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:e4**************@TK2MSFTNGP09.phx.gbl... Hi Boris,
ListViewItemCollection is a class declared inside ListView, it's not
a property of ListView, if you want to get the items in the ListView you have to use ListView.Items that is an instance of ListViewItemCollection. Your for loop will looks like: foreach(ListViewItem lvi in listView1.Items) { }
Hope this help,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
Actually, I didn't have problems with the IDE or at least I didn't spoted
any.
--
B\rgds
100
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:ey**************@TK2MSFTNGP09.phx.gbl... Hi,
Indeed it's a compiler bug, when I try to compile the code it gives me "Internal Compiler Error: stage 'COMPILE' among others.
I think that MS should get a report of this.
Also the IDE gets screw up, from that moment all the files in the
projects lost the colors for the reserved words and the autocomplete does not work, it's only after the delete the code and recompile that all return to
nornal.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message news:ew**************@TK2MSFTNGP10.phx.gbl... Yes, it fails with "internal compiler error". Looks like it is problem inside the compiler. At least it gives you the nearest point where to
look for an error.
-- B\rgds 100
"Boris" <ic*****@hotmail.com> wrote in message news:O4**************@tk2msftngp13.phx.gbl... Yes, I agree with You completely. But am I wrong by asking from
compiler to be more precice and not to fail with internal compiler error. Try to compile code that I passed. :)
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:e4**************@TK2MSFTNGP09.phx.gbl... > Hi Boris, > > > ListViewItemCollection is a class declared inside ListView, it's
not a > property of ListView, if you want to get the items in the ListView
you have > to use ListView.Items that is an instance of ListViewItemCollection. > Your for loop will looks like: > foreach(ListViewItem lvi in listView1.Items) > { > } > > Hope this help, > > -- > Ignacio Machin, > ignacio.machin AT dot.state.fl.us > Florida Department Of Transportation > >
Hi,
Mine got completed trashed.
I just added a new form to an existen windnows app, ( I removed the Main
method from the code listed ).
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Actually, I didn't have problems with the IDE or at least I didn't spoted any. -- B\rgds 100
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:ey**************@TK2MSFTNGP09.phx.gbl... Hi,
Indeed it's a compiler bug, when I try to compile the code it gives me "Internal Compiler Error: stage 'COMPILE' among others.
I think that MS should get a report of this.
Also the IDE gets screw up, from that moment all the files in the projects lost the colors for the reserved words and the autocomplete does not
work, it's only after the delete the code and recompile that all return to nornal.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message news:ew**************@TK2MSFTNGP10.phx.gbl... Yes, it fails with "internal compiler error". Looks like it is problem inside the compiler. At least it gives you the nearest point where to
look for an error.
-- B\rgds 100
"Boris" <ic*****@hotmail.com> wrote in message news:O4**************@tk2msftngp13.phx.gbl... > Yes, I agree with You completely. But am I wrong by asking from compiler to > be more precice and not to fail with internal compiler error. Try to compile > code that I passed. > :) > > "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT
dot.state.fl.us> wrote > in message news:e4**************@TK2MSFTNGP09.phx.gbl... > > Hi Boris, > > > > > > ListViewItemCollection is a class declared inside ListView, it's not a > > property of ListView, if you want to get the items in the ListView you > have > > to use ListView.Items that is an instance of
ListViewItemCollection. > > Your for loop will looks like: > > foreach(ListViewItem lvi in listView1.Items) > > { > > } > > > > Hope this help, > > > > -- > > Ignacio Machin, > > ignacio.machin AT dot.state.fl.us > > Florida Department Of Transportation > > > > > >
Can somebody please provide the version of the compiler you're using and any
service packs you've installed? I'm having trouble reproducing the internal
compiler error (I'm using 7.0).
--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:ew**************@TK2MSFTNGP10.phx.gbl... Yes, it fails with "internal compiler error". Looks like it is problem inside the compiler. At least it gives you the nearest point where to look for an error.
-- B\rgds 100
"Boris" <ic*****@hotmail.com> wrote in message news:O4**************@tk2msftngp13.phx.gbl... Yes, I agree with You completely. But am I wrong by asking from compiler to be more precice and not to fail with internal compiler error. Try to compile code that I passed. :)
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:e4**************@TK2MSFTNGP09.phx.gbl... Hi Boris,
ListViewItemCollection is a class declared inside ListView, it's not
a property of ListView, if you want to get the items in the ListView you have to use ListView.Items that is an instance of ListViewItemCollection. Your for loop will looks like: foreach(ListViewItem lvi in listView1.Items) { }
Hope this help,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
Thank you for posting this information. An internal compiler error
basically means the compiler crashed (AV, stack overflow, or something
worse) and tried to clean up after itself. Usually the IDE is stable enough
to save your work and exit, and that is exactly what I would recommend you
do whenever you get an internal compiler error. And please continue to
report them to MS.
--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uf**************@TK2MSFTNGP10.phx.gbl... Hi,
Mine got completed trashed. I just added a new form to an existen windnows app, ( I removed the Main method from the code listed ). Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation "Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Actually, I didn't have problems with the IDE or at least I didn't
spoted any. -- B\rgds 100
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:ey**************@TK2MSFTNGP09.phx.gbl... Hi,
Indeed it's a compiler bug, when I try to compile the code it gives
me "Internal Compiler Error: stage 'COMPILE' among others.
I think that MS should get a report of this.
Also the IDE gets screw up, from that moment all the files in the projects lost the colors for the reserved words and the autocomplete does not work, it's only after the delete the code and recompile that all return to nornal.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message news:ew**************@TK2MSFTNGP10.phx.gbl... > Yes, it fails with "internal compiler error". Looks like it is
problem > inside the compiler. At least it gives you the nearest point where
to look > for an error. > > -- > B\rgds > 100 > > "Boris" <ic*****@hotmail.com> wrote in message > news:O4**************@tk2msftngp13.phx.gbl... > > Yes, I agree with You completely. But am I wrong by asking from compiler > to > > be more precice and not to fail with internal compiler error. Try
to > compile > > code that I passed. > > :) > > > > "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> > wrote > > in message news:e4**************@TK2MSFTNGP09.phx.gbl... > > > Hi Boris, > > > > > > > > > ListViewItemCollection is a class declared inside ListView,
it's not a > > > property of ListView, if you want to get the items in the
ListView you > > have > > > to use ListView.Items that is an instance of ListViewItemCollection. > > > Your for loop will looks like: > > > foreach(ListViewItem lvi in listView1.Items) > > > { > > > } > > > > > > Hope this help, > > > > > > -- > > > Ignacio Machin, > > > ignacio.machin AT dot.state.fl.us > > > Florida Department Of Transportation > > > > > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ray |
last post by:
Hi,
I am receiving this message in the output during
compilation; it is not an error nor a warning. I have
<myAssembly> as a library assembly included as part of my
solution, and I have also...
|
by: ideas2050 |
last post by:
Observed a compilation error reporting differences between VC++ 6.0 and
7.0 VS .NET 2003.
Seeking opinions.
Here is the code abbreviated:-
main()
{
|
by: Sune |
last post by:
Hi,
previously I used Eclipse CDT for compiling my files just to get
started with C and leave C++ behind. Now it's time to get a little more
serious so I've moved my files to a new workplace and...
|
by: Joachim |
last post by:
I made some project changes (which seems it doesn't help if I undo) which
have created compilation error:
"
Server Error in '/PCSWebApp1' Application....
|
by: Dan |
last post by:
Hi,
I have a problem using an aspx page with a Control on it. I get the
following error message
Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple
places; using definition...
|
by: Plat |
last post by:
I've Googled this for a while, to no avail. Hopefully someone can help me.
Maybe I'm using the wrong terminology.
Here's the scoop! Let's say I've got a simple *.ASPX page that has a syntax...
|
by: Paulustrious |
last post by:
Newbie using VC# Express.....
Part the First
========
Can some one tell me why Example 1 compiles and Example 2 does not...
Example 1
------------
using System;
|
by: BSand0764 |
last post by:
I'm getting an error that I can't seem to resolve. When I compile the
Functor related logic in a test program, the files compile and execute
properly (see Listing #1).
However, when I...
|
by: Roumen Petrov |
last post by:
Hi list members,
It seems to me that this is discussed many times in the past but without
progress. As I understand in general there is no objections and
preferred cross-compilation has to be...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |