Click here to Skip to main content
15,914,160 members
Home / Discussions / C#
   

C#

 
AnswerRe: Export data to datagerid Pin
basumca14-Oct-06 0:11
basumca14-Oct-06 0:11 
QuestionMulticolor Ellipse Pin
The underdog13-Oct-06 2:14
The underdog13-Oct-06 2:14 
AnswerRe: Multicolor Ellipse Pin
rah_sin13-Oct-06 2:45
professionalrah_sin13-Oct-06 2:45 
GeneralRe: Multicolor Ellipse Pin
The underdog13-Oct-06 3:07
The underdog13-Oct-06 3:07 
AnswerRe: Multicolor Ellipse Pin
mav.northwind13-Oct-06 5:21
mav.northwind13-Oct-06 5:21 
QuestionMSMQ queuing vba process sends, C# process receive Pin
rodrigorodriquez13-Oct-06 2:01
rodrigorodriquez13-Oct-06 2:01 
QuestionCall C# Code within DTS Pin
Zeeshan Gulzar13-Oct-06 1:25
Zeeshan Gulzar13-Oct-06 1:25 
QuestionNewbie: Problem invoking?? Pin
Phillip Hodges13-Oct-06 1:07
Phillip Hodges13-Oct-06 1:07 
Hello all, I have run into a problem... I am trying to call a method from a thread but it is throwing an exception...

System.NullReferenceException was unhandled<br />
  Message="Object reference not set to an instance of an object."<br />
  Source="System.Windows.Forms"


Here is the code:

public void zap_publish_listview(zap item)<br />
        {<br />
            if (listView_main.InvokeRequired)<br />
            {<br />
                SetZapPublishListview s = new SetZapPublishListview(zap_publish_listview);<br />
                Invoke(s, new object[] { item });<br />
            }<br />
            else<br />
            {<br />
                // Extract data from zap item<br />
                int icon = getStatusIconNumber(item.zap_state.ToString());<br />
                string name = item.zap_channel.ToString();<br />
                string data = item.zap_state.ToString();<br />
<br />
                // Create listview item<br />
                ListViewItem lvItem = new ListViewItem("", icon);<br />
                lvItem.SubItems.Add("ZAP: " + name);<br />
                lvItem.SubItems.Add(data);<br />
                lvItem.ToolTipText = item.ToString();<br />
                lvItem.Group = listView_main.Groups[2]; // ZAP group is index 2<br />
<br />
                // Find location of listview item to be replaced<br />
                ListViewItem old_item = listView_main.FindItemWithText("ZAP: " + name, true, 0);<br />
<br />
                // If item exists<br />
                if (old_item.Index >= 0)<br />
                {<br />
                    // Insert listview item<br />
                    listView_main.Items.Insert(old_item.Index, lvItem);<br />
<br />
                    // Remove old item<br />
                    listView_main.Items.RemoveAt(old_item.Index);<br />
                }<br />
                else<br />
                {<br />
                    // Insert listview item<br />
                    listView_main.Items.AddRange(new ListViewItem[] { lvItem });<br />
                }<br />
            }<br />
        }<br />


I have a similar method that updates a debug window... And that works fine... Can anyone help???


Thanks in advance,

Phil

"Rules are for the obedience of fools and the guidance of wise men"

AnswerRe: Newbie: Problem invoking?? Pin
Christian Graus13-Oct-06 1:24
protectorChristian Graus13-Oct-06 1:24 
QuestionHow to display a word document in a winform Pin
JollyBob197413-Oct-06 0:48
JollyBob197413-Oct-06 0:48 
QuestionProgrammer's "I need your help" Pin
I A Khan13-Oct-06 0:42
I A Khan13-Oct-06 0:42 
QuestionWhere can i get a machine specific code of some sort? Pin
Anthony Mushrow12-Oct-06 23:48
professionalAnthony Mushrow12-Oct-06 23:48 
AnswerRe: Where can i get a machine specific code of some sort? Pin
Amar Chaudhary12-Oct-06 23:58
Amar Chaudhary12-Oct-06 23:58 
GeneralRe: Where can i get a machine specific code of some sort? Pin
Anthony Mushrow13-Oct-06 0:11
professionalAnthony Mushrow13-Oct-06 0:11 
GeneralRe: Where can i get a machine specific code of some sort? Pin
Amar Chaudhary13-Oct-06 1:36
Amar Chaudhary13-Oct-06 1:36 
GeneralRe: Where can i get a machine specific code of some sort? Pin
Anthony Mushrow13-Oct-06 4:49
professionalAnthony Mushrow13-Oct-06 4:49 
GeneralRe: Where can i get a machine specific code of some sort? Pin
Dave Kreskowiak13-Oct-06 6:57
mveDave Kreskowiak13-Oct-06 6:57 
AnswerRe: Where can i get a machine specific code of some sort? Pin
Daniel Grunwald13-Oct-06 7:15
Daniel Grunwald13-Oct-06 7:15 
GeneralRe: Where can i get a machine specific code of some sort? Pin
Anthony Mushrow13-Oct-06 12:58
professionalAnthony Mushrow13-Oct-06 12:58 
GeneralRe: Where can i get a machine specific code of some sort? Pin
mav.northwind13-Oct-06 22:21
mav.northwind13-Oct-06 22:21 
Questionhow to debug Com Components in .net applications? Pin
vinay_inavolu12-Oct-06 23:41
vinay_inavolu12-Oct-06 23:41 
AnswerRe: how to debug Com Components in .net applications? Pin
Sreenath Madyastha13-Oct-06 4:17
Sreenath Madyastha13-Oct-06 4:17 
QuestionHelp!! develop Directx9.0 with C# Pin
BestYangFeng12-Oct-06 23:34
BestYangFeng12-Oct-06 23:34 
AnswerRe: Help!! develop Directx9.0 with C# Pin
Amar Chaudhary12-Oct-06 23:53
Amar Chaudhary12-Oct-06 23:53 
QuestionC# Windows Application Setup Pin
quiteSmart12-Oct-06 22:30
quiteSmart12-Oct-06 22:30 

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.