Program closes without warning.

frederick

Member
Joined
Oct 24, 2008
Messages
7
Location
Des Moines, WA
Programming Experience
5-10
I have an application (built using Visual Basics 2005) that is being used at work for inventory. It is running on multiple desktops and without any issues. There is one desktop that when I launch the program, the program closes automatically without warning or an error message.

Process of operations:
1. Click to start the program.
2. The application automatically checks to see if there are any updates.
3. The program opens and becomes interactive.

At step 3, the program closes automatic and this is where I am confused at where the issue may be. During the installation, all requirements have been meet and the program installs OK.

Any ideas from anyone of where to begin looking.
 
Last edited:
set the startup object to a Sub Main, and have a code:

VB.NET:
Public Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(false)
  Try
            Application.Run(new MainForm())
  Catch Exception ex
    MessageBox.Show(ex.StackTrace)
  End Try
End Sub
 
Let me see if I understand.

1. The issue may be related to the users theme they have on there desktop.

2. Copy the code you indicated into my opening form and rename MainForm() to match the opening form name.
 
Let me see if I understand.

1. The issue may be related to the users theme they have on there desktop.
Probably not, I just provided a VB.NET version of what every C# programmer has to write to "make his windows forms app go" because we DONT have a page in project properties that looks like the attachment (VB team made it easier for vb developers to make their program go, but you dont have control over error handling)

2. Copy the code you indicated into my opening form and rename MainForm() [in the code] to match the opening form name.
That would work but there are extra steps. Just write that code I gave, into a Module (maybe youre allowed to omit "Shared" in that case, because Module is Shared by default) and go into project properties (like attachment) and say that Startup Object is not Form1, but Sub Main. Also disable Application Framework (and hopefully you arent using the single instance functionality)

Then press DEBUG >> STEP INTO to see what I mean..
 

Attachments

  • View-Application-Events.png
    View-Application-Events.png
    17.6 KB · Views: 33
Back
Top