Nasenbaer
Nasenbaer

Reputation: 4900

Application Sub Main

I've created an .Net application. Now I wanted to include a application crashed - I am sorry messagebox. But I cannot find any Sub Main() routine or even if I create my new own module I am not able to selecte the Sub Main() in the module as startobject.

Any advice?

Application Sub Main

Upvotes: 0

Views: 172

Answers (1)

Cody Gray
Cody Gray

Reputation: 245022

Did you create a VB.NET application? If so, you'll need to add your own Sub Main(). The disadvantage of this, however, is that you'll have to manually handle all of the startup processing and initialization that the .NET Framework normally does for you automatically.

But if all you want to do is show an error message when an unhandled exception occurs, there's no reason to create your own Sub Main(). All you have to do is add a handler for the AppDomain.UnhandledException event.

Upvotes: 2

Related Questions