Click here to Skip to main content
15,888,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: SQL Table Pin
kibromg15-Jul-09 7:01
kibromg15-Jul-09 7:01 
GeneralRe: SQL Table Pin
dan!sh 15-Jul-09 7:03
professional dan!sh 15-Jul-09 7:03 
GeneralRe: SQL Table Pin
kibromg15-Jul-09 7:15
kibromg15-Jul-09 7:15 
GeneralRe: SQL Table [modified] Pin
musefan15-Jul-09 8:08
musefan15-Jul-09 8:08 
AnswerRe: SQL Table Pin
Luc Pattyn15-Jul-09 8:24
sitebuilderLuc Pattyn15-Jul-09 8:24 
GeneralRe: SQL Table Pin
musefan15-Jul-09 21:53
musefan15-Jul-09 21:53 
AnswerRe: SQL Table Pin
Pete O'Hanlon15-Jul-09 10:02
mvePete O'Hanlon15-Jul-09 10:02 
GeneralRe: SQL Table Pin
Not Active15-Jul-09 10:10
mentorNot Active15-Jul-09 10:10 
QuestionHow to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 5:16
astv15-Jul-09 5:16 
AnswerRe: How to implement a timer in Windows Service correctly? Pin
DoctorMick15-Jul-09 6:04
DoctorMick15-Jul-09 6:04 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 6:13
astv15-Jul-09 6:13 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
DoctorMick15-Jul-09 6:26
DoctorMick15-Jul-09 6:26 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 10:41
astv15-Jul-09 10:41 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
Luc Pattyn15-Jul-09 6:26
sitebuilderLuc Pattyn15-Jul-09 6:26 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 10:43
astv15-Jul-09 10:43 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
Paladin200015-Jul-09 6:27
Paladin200015-Jul-09 6:27 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 10:45
astv15-Jul-09 10:45 
AnswerRe: How to implement a timer in Windows Service correctly? Pin
dan!sh 15-Jul-09 6:28
professional dan!sh 15-Jul-09 6:28 
QuestionOutlook newitem event issue [modified] Pin
ghoster00715-Jul-09 5:06
ghoster00715-Jul-09 5:06 
I'm trying to make a helpdesk application that processes incoming emails for a specific account. I'm having trouble with the Itemadd event. It will quit after receiving around 17-28 emails and I have to restart the program. I have not found much online about this issue besides it's probably a scope problem and the GC is killing the event. I did make a stripped down version of the program which seems to work fine but I dont know why it works when this one doesn't.


In the load function of the form im using this for getting the namespace and the correct store. All variables not initialized in the code are private.

If I comment out treeview1_add function it'll work up to 30 emails which probably means it's working. However I do not know why commenting out that function will make it work and I need that function.

thank you for any help you can give me.
<code>
void form_load()
{
   mapi = outlookapp.GetNamespace("MAPI");

                int helpdeskcount = 1;
                int count = 1;
                while (count <= mapi.Stores.Count)
                {
                    if (mapi.Stores[count].DisplayName.Contains("Storename"))
                    {
                        helpdeskcount = count;
                        count = mapi.Stores.Count;
                    }
                    count++;
                }
                oinbox = mapi.Folders[helpdeskcount];
                helpdesk = oinbox.Folders["Inbox"];
                helpdesk.Items.ItemAdd += new ItemsEvents_ItemAddEventHandler(Items_ItemAdd);  
}
   void Items_ItemAdd(object Item)
        {

              load_unassigned();  
              counter();//debug use to see how many emails come in
        }

 void counter()
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Invoker_no_strings(this.counter));

            }
            else
            {
                int count = int.Parse(label1.Text);
                count++;
                label1.Text = count.ToString();
            }
        }

      public void load_unassigned()
        {
           
         
                tree_node_clear(treeView1);
                incident_load = new tbl_incidents_BLL();
                 tempnode = null;
                 arrtemp = incident_load.loadallunassigned();
                
                int length = arrtemp.GetLength(0);
                int count = 0;
             
                while (count < length)
                {
                  
                   treeview1_add(arrtemp[count, 0], arrtemp[count, 1] + ":  " + arrtemp[count, 3]);//if i comment this out it'll work to at least 30 emails 
                  
                    count++;
                }
            }

    public  void tree_node_clear(TreeView temp)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new tree_clear(this.tree_node_clear), temp);
            }
            else
            {
                temp.Nodes.Clear();


            }

        }

      public void treeview1_add(string id, string value)
        {


            if (this.InvokeRequired)
            {
               
                    this.Invoke(new treeview1_add_delegate(this.treeview1_add), id, value);
       
                
            }
            else
            {
              
                    treeView1.Nodes.Add(id, value);
                
                   
                
            }
          
        }
}</code>


ghoster

modified on Wednesday, July 15, 2009 12:04 PM

AnswerRe: Outlook newitem event issue Pin
Luc Pattyn15-Jul-09 6:19
sitebuilderLuc Pattyn15-Jul-09 6:19 
GeneralRe: Outlook newitem event issue Pin
ghoster00715-Jul-09 7:00
ghoster00715-Jul-09 7:00 
GeneralRe: Outlook newitem event issue Pin
Luc Pattyn15-Jul-09 7:08
sitebuilderLuc Pattyn15-Jul-09 7:08 
GeneralRe: Outlook newitem event issue Pin
ghoster00715-Jul-09 9:08
ghoster00715-Jul-09 9:08 
QuestionUse of GC.SuppressFinalize in ref counted objects Pin
molesworth15-Jul-09 4:55
molesworth15-Jul-09 4:55 
QuestionCreating four dimensional control Pin
gwithey15-Jul-09 4:32
gwithey15-Jul-09 4:32 

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.