[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 250
  • Last Modified:

VS 2008 C# Screen Lockups

I have a series class libraries that I have added to an external application that present various screens to the users. About 2 or 3 times a month all screens become unresponsive and the solution is to leave the application and come back in. It is virtually impossible to repeat what is causing this, I have tested all the screens individually and inside each program I have error capture routines that never return anything, the programs simply do not run. What kinds of traps can I use to determine why they fail to fire when called? I have attached a sample of my code to show how I invoke forms.
public void ViewAppliedDocuments(object sender, EventArgs e)
        {
            if (ViewAppliedDocumentsForm == null || ViewAppliedDocumentsForm.Created == false)
            {
                ViewAppliedDocumentsForm = new frmViewAppliedDocuments();
            }

            ViewAppliedDocumentsForm.Show();
            ViewAppliedDocumentsForm.Activate();
            ViewAppliedDocumentsForm.Focus();
        }

Open in new window

0
rwheeler23
Asked:
rwheeler23
  • 2
2 Solutions
 
JuanCarnigliaCommented:
Check that you are correctly disposing this forms, use also a try-catch block, and keep memory usage in check. Maybe you will have to call the garbage collector.

Greetings
0
 
rwheeler23Author Commented:
Good point, there are about 12 pieces of code. I will check them all for the disposal of the form. All of my programs have an exit button plus they can click on the 'X' . I will  make sure the dispose method is in both places. I have never used the garbage collector. Can you provide any links that provide insight on how to use this?
0
 
JuanCarnigliaCommented:
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now