473,383 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

main() in module sub

Hi,

I have my start point set to the main() sub in a module.

In main() I then show my form using the show.dialog method.

Problem I am having is that when an error fires anywhere it the app it falls
back into the main(), and then goes on with code after the showdialog line,
which ends my app.

I know I should be managing my errors better, but I was wondering if the
showdialog is the best way
Nov 20 '05 #1
2 1194
Use Application.Run(frm) instead of frm.ShowDialog(). For example:
Public Shared Sub Main()
Application.Run(New TestForm())
End Sub

Tom Dacon
"news.microsoft.com" <au****@aussie.com> wrote in message
news:eg**************@TK2MSFTNGP09.phx.gbl...
Hi,

I have my start point set to the main() sub in a module.

In main() I then show my form using the show.dialog method.

Problem I am having is that when an error fires anywhere it the app it falls back into the main(), and then goes on with code after the showdialog line, which ends my app.

I know I should be managing my errors better, but I was wondering if the
showdialog is the best way

Nov 20 '05 #2
* "news.microsoft.com" <au****@aussie.com> scripsit:
I have my start point set to the main() sub in a module.

In main() I then show my form using the show.dialog method.

Problem I am having is that when an error fires anywhere it the app it falls
back into the main(), and then goes on with code after the showdialog line,
which ends my app.

I know I should be managing my errors better, but I was wondering if the
showdialog is the best way


Use 'Application.Run(New MainForm())' instead. Nevertheless, this won't
help if there are no error handlers implemented...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Fred Zwarts | last post by:
In C++ execution of a program starts already before execution of main(). The initialization of static variables defined outside the scope of main is performed first. I could imagine a program where...
75
by: Beni | last post by:
I have been programming in C for about a year now. It sounds silly, but I never took the time to question why a C(or C++ or Java) program execution begins only at the main(). Is it a convention or...
8
by: kyle | last post by:
Hi ther I have a small vb.net 2003 program with 5 forms: form1, form2, et I have a module in the program from where I want to launch form1 - the main for In the module I have a bunch of public...
17
by: Fred Nelson | last post by:
Hi: I'm trying to implement an overall error handler in my VB.NET windows application. I need to place an "On Error Goto" in "Sub Main". I have tried to create a Sub Main and have had no...
16
by: Geoff Jones | last post by:
Hi What is the closest equivalent to Main in a VB.Net form? Geoff
9
by: TechN00b | last post by:
I'm trying to write a quick commandline app that takes a string from the commandline and returns a formatted md5 hash. Unfortunately the code won't comple and returns an error of "No accessible...
2
by: netdrake | last post by:
Hi everyone! I have some functions in main application (for example: log(), uppercase(), ...) and some in created module.so(counter() ...) But how can functions in module.so access to functions in...
11
by: Jim | last post by:
Hi, I have created an import module. And would like to access a function from the main script, e.g., file abc.py: ################### def a(): m() return None
6
by: fatwallet961 | last post by:
is the main function in python is exact compare to Java main method? all execution start in main which may takes arguments? like the follow example script - def main(argv): ...
3
by: Peter | last post by:
Hi, I have a project with an MDI parent form (Main), which can contain any number of MDI children (Document). The Document form contains several user controls, designed as separate projects and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.