StackOverflowExceptionUnhandled

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhagyap
    New Member
    • Nov 2011
    • 14

    StackOverflowExceptionUnhandled

    this.tableLayou tPanel1.ResumeL ayout(false);

    An unhandled exception of type 'System.StackOv erflowException ' occurred in mscorlib.dll occurred for the above line.. Please help me...
  • adriancs
    New Member
    • Apr 2011
    • 122

    #2
    for this problem, you need to post the whole code of the class.

    Comment

    • Paul Johnson
      New Member
      • Oct 2010
      • 97

      #3
      StackOverflowEx ception is thrown whenever your stack overflows, which usually happens due to recursive functions. This is almost always something like a property or method calling itself infinitely, etc, but there are other things that can cause the stack to overflow.

      As adriancs has said, without seeing the code, it's not possible to diagnose properly.

      What I'd look for is that you're not generating a massive loop somewhere that generates tables within tables within tables (from experience, this does it...)

      Comment

      • bhagyap
        New Member
        • Nov 2011
        • 14

        #4
        namespace SplashScreen
        {
        public partial class SearchResults : DockContent
        {

        #region Initialize Component

        public SearchResults()
        {
        InitializeCompo nent();
        }

        #endregion

        #region Listview Items

        private void listView1_Doubl eClick(object sender, EventArgs e)
        {
        try
        {
        DummyDock dummyDoc = new DummyDock();
        TreeView treeview = new TreeView();
        FileStream fs = new FileStream(@"E: \zoomdocs\docs. xml", FileMode.Open, FileAccess.Read );
        if (this.listView1 .SelectedItems. Count != 1)
        return;

        string path = (string)this.li stView1.Selecte dItems[0].Tag;
        dummyDoc.webBro wser1.Navigate( path);
        dummyDoc.Show(D ockPanel);
        //string filename = treeview.treeVi ew1.SelectedNod e.Name.ToString ();
        dummyDoc.label1 .Text = "Title of File:- " + listView1.Selec tedItems[0].Tag;

        DateTime filemod = File.GetLastAcc essTime(fs.Name );
        dummyDoc.label2 .Text = "Date and Time of File Modified :- " + filemod.ToStrin g();

        dummyDoc.Text = (string)listVie w1.SelectedItem s[0].Tag;
        }
        catch (Exception ex)
        {
        MessageBox.Show (ex.Message,"Ex ception",Messag eBoxButtons.OK, MessageBoxIcon. Error);
        }

        #endregion

        }

        }
        }

        And the designer of this is as follows:-

        namespace SplashScreen
        {
        partial class SearchResults
        {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.Componen tModel.IContain er components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing ">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
        if (disposing && (components != null))
        {
        components.Disp ose();
        }
        base.Dispose(di sposing);
        }

        #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 InitializeCompo nent()
        {
        this.columnHead er1 = new System.Windows. Forms.ColumnHea der();
        this.listView1 = new System.Windows. Forms.ListView( );
        this.columnHead er2 = new System.Windows. Forms.ColumnHea der();
        this.columnHead er3 = new System.Windows. Forms.ColumnHea der();
        this.tableLayou tPanel1 = new System.Windows. Forms.TableLayo utPanel();
        this.tableLayou tPanel1.Suspend Layout();
        this.SuspendLay out();
        //
        // columnHeader1
        //
        this.columnHead er1.Text = "Folder";
        //
        // listView1
        //
        this.listView1. Columns.AddRang e(new System.Windows. Forms.ColumnHea der[] {
        this.columnHead er2,
        this.columnHead er1,
        this.columnHead er3});
        this.listView1. Dock = System.Windows. Forms.DockStyle .Fill;
        this.listView1. Location = new System.Drawing. Point(3, 3);
        this.listView1. Name = "listView1" ;
        this.listView1. Size = new System.Drawing. Size(278, 256);
        this.listView1. TabIndex = 0;
        this.listView1. UseCompatibleSt ateImageBehavio r = false;
        this.listView1. View = System.Windows. Forms.View.Deta ils;
        //
        // columnHeader2
        //
        this.columnHead er2.Text = "";
        //
        // columnHeader3
        //
        this.columnHead er3.Text = "Name";
        //
        // tableLayoutPane l1
        //
        this.tableLayou tPanel1.ColumnC ount = 1;
        this.tableLayou tPanel1.ColumnS tyles.Add(new System.Windows. Forms.ColumnSty le(System.Windo ws.Forms.SizeTy pe.Percent, 100F));
        this.tableLayou tPanel1.Control s.Add(this.list View1, 0, 0);
        this.tableLayou tPanel1.Dock = System.Windows. Forms.DockStyle .Fill;
        this.tableLayou tPanel1.Locatio n = new System.Drawing. Point(0, 0);
        this.tableLayou tPanel1.Name = "tableLayoutPan el1";
        this.tableLayou tPanel1.RowCoun t = 1;
        this.tableLayou tPanel1.RowStyl es.Add(new System.Windows. Forms.RowStyle( System.Windows. Forms.SizeType. Percent, 100F));
        this.tableLayou tPanel1.RowStyl es.Add(new System.Windows. Forms.RowStyle( System.Windows. Forms.SizeType. Absolute, 20F));
        this.tableLayou tPanel1.Size = new System.Drawing. Size(284, 262);
        this.tableLayou tPanel1.TabInde x = 2;
        //
        // SearchResults
        //
        this.AutoScaleD imensions = new System.Drawing. SizeF(6F, 13F);
        this.AutoScaleM ode = System.Windows. Forms.AutoScale Mode.Font;
        this.ClientSize = new System.Drawing. Size(284, 262);
        this.Controls.A dd(this.tableLa youtPanel1);
        this.Font = new System.Drawing. Font("Microsoft Sans Serif", 8.25F, System.Drawing. FontStyle.Regul ar, System.Drawing. GraphicsUnit.Po int, ((byte)(0)));
        this.Name = "SearchResults" ;
        this.Text = "SearchResults" ;
        this.tableLayou tPanel1.ResumeL ayout(false);
        this.ResumeLayo ut(false);

        }

        #endregion

        private System.Windows. Forms.ColumnHea der columnHeader1;
        public System.Windows. Forms.ListView listView1;
        private System.Windows. Forms.ColumnHea der columnHeader2;
        private System.Windows. Forms.ColumnHea der columnHeader3;
        private System.Windows. Forms.TableLayo utPanel tableLayoutPane l1;
        }
        }namespace SplashScreen
        {
        partial class SearchResults
        {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.Componen tModel.IContain er components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing ">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
        if (disposing && (components != null))
        {
        components.Disp ose();
        }
        base.Dispose(di sposing);
        }

        #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 InitializeCompo nent()
        {
        this.columnHead er1 = new System.Windows. Forms.ColumnHea der();
        this.listView1 = new System.Windows. Forms.ListView( );
        this.columnHead er2 = new System.Windows. Forms.ColumnHea der();
        this.columnHead er3 = new System.Windows. Forms.ColumnHea der();
        this.tableLayou tPanel1 = new System.Windows. Forms.TableLayo utPanel();
        this.tableLayou tPanel1.Suspend Layout();
        this.SuspendLay out();
        //
        // columnHeader1
        //
        this.columnHead er1.Text = "Folder";
        //
        // listView1
        //
        this.listView1. Columns.AddRang e(new System.Windows. Forms.ColumnHea der[] {
        this.columnHead er2,
        this.columnHead er1,
        this.columnHead er3});
        this.listView1. Dock = System.Windows. Forms.DockStyle .Fill;
        this.listView1. Location = new System.Drawing. Point(3, 3);
        this.listView1. Name = "listView1" ;
        this.listView1. Size = new System.Drawing. Size(278, 256);
        this.listView1. TabIndex = 0;
        this.listView1. UseCompatibleSt ateImageBehavio r = false;
        this.listView1. View = System.Windows. Forms.View.Deta ils;
        //
        // columnHeader2
        //
        this.columnHead er2.Text = "";
        //
        // columnHeader3
        //
        this.columnHead er3.Text = "Name";
        //
        // tableLayoutPane l1
        //
        this.tableLayou tPanel1.ColumnC ount = 1;
        this.tableLayou tPanel1.ColumnS tyles.Add(new System.Windows. Forms.ColumnSty le(System.Windo ws.Forms.SizeTy pe.Percent, 100F));
        this.tableLayou tPanel1.Control s.Add(this.list View1, 0, 0);
        this.tableLayou tPanel1.Dock = System.Windows. Forms.DockStyle .Fill;
        this.tableLayou tPanel1.Locatio n = new System.Drawing. Point(0, 0);
        this.tableLayou tPanel1.Name = "tableLayoutPan el1";
        this.tableLayou tPanel1.RowCoun t = 1;
        this.tableLayou tPanel1.RowStyl es.Add(new System.Windows. Forms.RowStyle( System.Windows. Forms.SizeType. Percent, 100F));
        this.tableLayou tPanel1.RowStyl es.Add(new System.Windows. Forms.RowStyle( System.Windows. Forms.SizeType. Absolute, 20F));
        this.tableLayou tPanel1.Size = new System.Drawing. Size(284, 262);
        this.tableLayou tPanel1.TabInde x = 2;
        //
        // SearchResults
        //
        this.AutoScaleD imensions = new System.Drawing. SizeF(6F, 13F);
        this.AutoScaleM ode = System.Windows. Forms.AutoScale Mode.Font;
        this.ClientSize = new System.Drawing. Size(284, 262);
        this.Controls.A dd(this.tableLa youtPanel1);
        this.Font = new System.Drawing. Font("Microsoft Sans Serif", 8.25F, System.Drawing. FontStyle.Regul ar, System.Drawing. GraphicsUnit.Po int, ((byte)(0)));
        this.Name = "SearchResults" ;
        this.Text = "SearchResults" ;
        this.tableLayou tPanel1.ResumeL ayout(false);
        this.ResumeLayo ut(false);

        }

        #endregion

        private System.Windows. Forms.ColumnHea der columnHeader1;
        public System.Windows. Forms.ListView listView1;
        private System.Windows. Forms.ColumnHea der columnHeader2;
        private System.Windows. Forms.ColumnHea der columnHeader3;
        private System.Windows. Forms.TableLayo utPanel tableLayoutPane l1;
        }
        }
        This is my code..Please help me..

        Comment

        Working...