Click here to Skip to main content
15,919,778 members
Home / Discussions / C#
   

C#

 
Questionreader is closed how can i solve this Pin
cutedrew25-Nov-08 14:13
cutedrew25-Nov-08 14:13 
AnswerRe: reader is closed how can i solve this Pin
Christian Graus25-Nov-08 14:47
protectorChristian Graus25-Nov-08 14:47 
GeneralRe: reader is closed how can i solve this Pin
Paul Conrad25-Nov-08 18:30
professionalPaul Conrad25-Nov-08 18:30 
GeneralRe: reader is closed how can i solve this Pin
Christian Graus25-Nov-08 18:53
protectorChristian Graus25-Nov-08 18:53 
GeneralRe: reader is closed how can i solve this Pin
Paul Conrad25-Nov-08 18:56
professionalPaul Conrad25-Nov-08 18:56 
AnswerRe: reader is closed how can i solve this Pin
Guffa25-Nov-08 15:06
Guffa25-Nov-08 15:06 
AnswerRe: reader is closed how can i solve this Pin
Giorgi Dalakishvili25-Nov-08 19:31
mentorGiorgi Dalakishvili25-Nov-08 19:31 
QuestionNullReferenceException with delegate function. Pin
Teuz25-Nov-08 12:54
Teuz25-Nov-08 12:54 
Hi guys,
I'm starting out with C# and since I dont like messing with simple things (Big Grin | :-D ) I'm already "playing" with threads and delegates. In my program I create a net socket, connect to a server and start to receive data async with BeginReceive.
When a message is received, the program(secondary thread of BeginReceive) pass it to RlsInsert(message) that split it with a regular expression and populate a listview. It seems to work perfectly but randomly VS pops up with an exception about NullReferenceException and tells me to use the "new" keyword, but as you can see I'm already using it:

//Add item to the list view
public delegate void RlsInsertCallback(string text);

public void RlsInsert(string text)
{
if (this.InvokeRequired)
this.Invoke(new RlsInsertCallback(this.RlsInsert),new object[] { text }); <--- expection on this line pointin to object[]
else
{
**more code that check text with regular expression, split text and populate subitems etc
lvRelease.Items.Add(aItem);

}
}

Can anybody tell me what I am doing wrong? Because I cant figure it out. It works and then It crashes after a while.
Sorry if this has already been asked, I did used search but I could not find anything that really match my problem.
Thank you in advance.
Matteo
AnswerRe: NullReferenceException with delegate function. Pin
Christian Graus25-Nov-08 14:01
protectorChristian Graus25-Nov-08 14:01 
GeneralRe: NullReferenceException with delegate function. Pin
Teuz25-Nov-08 14:24
Teuz25-Nov-08 14:24 
GeneralRe: NullReferenceException with delegate function. Pin
Christian Graus25-Nov-08 14:54
protectorChristian Graus25-Nov-08 14:54 
GeneralRe: NullReferenceException with delegate function. Pin
Teuz25-Nov-08 23:28
Teuz25-Nov-08 23:28 
Questionlistbox index Pin
netJP12L25-Nov-08 10:28
netJP12L25-Nov-08 10:28 
AnswerRe: listbox index Pin
Christian Graus25-Nov-08 12:02
protectorChristian Graus25-Nov-08 12:02 
QuestionDrag Drop | Getting drop location in explorer Pin
Corayzon25-Nov-08 10:19
Corayzon25-Nov-08 10:19 
QuestionControl Paints Different in App and Designer Pin
#realJSOP25-Nov-08 8:15
professional#realJSOP25-Nov-08 8:15 
AnswerRe: Control Paints Different in App and Designer Pin
Giorgi Dalakishvili25-Nov-08 8:55
mentorGiorgi Dalakishvili25-Nov-08 8:55 
GeneralRe: Control Paints Different in App and Designer Pin
#realJSOP25-Nov-08 9:36
professional#realJSOP25-Nov-08 9:36 
QuestionExcel 2003 XML Format and Images Pin
GibbleCH25-Nov-08 6:54
GibbleCH25-Nov-08 6:54 
AnswerRe: Excel 2003 XML Format and Images Pin
Dave Kreskowiak25-Nov-08 8:40
mveDave Kreskowiak25-Nov-08 8:40 
GeneralRe: Excel 2003 XML Format and Images Pin
GibbleCH25-Nov-08 8:44
GibbleCH25-Nov-08 8:44 
GeneralRe: Excel 2003 XML Format and Images Pin
Dave Kreskowiak25-Nov-08 9:47
mveDave Kreskowiak25-Nov-08 9:47 
GeneralRe: Excel 2003 XML Format and Images Pin
GibbleCH25-Nov-08 11:50
GibbleCH25-Nov-08 11:50 
GeneralRe: Excel 2003 XML Format and Images Pin
Dave Kreskowiak25-Nov-08 15:06
mveDave Kreskowiak25-Nov-08 15:06 
GeneralRe: Excel 2003 XML Format and Images Pin
GibbleCH25-Nov-08 15:11
GibbleCH25-Nov-08 15:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.