473,396 Members | 1,826 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,396 software developers and data experts.

app ends after sub main()

Ben
could someone please suggest to me another way to work around sub main? I am
currently migrating 6.0 codes over to .net. as soon as sub main() ran, vb
ends the application immediately. So I moved my codes to over to my splash
screen form. Made my project preference to run from splash screen as start
up. after the splash screen is shown, I ordered it to show my next screen by
calling to a new instance of that new screen. However, no matter what I do,
my program failed to display my next screen. My application keeps ending
itself.

Is there another way to work around these issues? Thanks.
Nov 21 '05 #1
4 1357
Do you have Application.Run call in your main?

HTH
Alex
"Ben" <Be*@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
could someone please suggest to me another way to work around sub main? I am currently migrating 6.0 codes over to .net. as soon as sub main() ran, vb
ends the application immediately. So I moved my codes to over to my splash screen form. Made my project preference to run from splash screen as start up. after the splash screen is shown, I ordered it to show my next screen by calling to a new instance of that new screen. However, no matter what I do, my program failed to display my next screen. My application keeps ending
itself.

Is there another way to work around these issues? Thanks.

Nov 21 '05 #2
"Ben" <Be*@discussions.microsoft.com> schrieb:
could someone please suggest to me another way to work around sub main? I
am
currently migrating 6.0 codes over to .net. as soon as sub main() ran, vb
ends the application immediately. So I moved my codes to over to my
splash
screen form. Made my project preference to run from splash screen as
start
up. after the splash screen is shown, I ordered it to show my next screen
by
calling to a new instance of that new screen. However, no matter what I
do,
my program failed to display my next screen. My application keeps ending
itself.


\\\
Public Module Program
Private m_Context As ApplicationContext

Public Sub Main()
Context = New ApplicationContext()
Context.MainForm = New SplashForm()
Application.Run(Context)
End Sub

Public Property Context() As ApplicationContext
Get
Return m_Context
End Get
Set(ByVal Value As ApplicationContext)
m_Context = Value
End Set
End Property
End Module

Public Class SplashForm
Inherits Form

Private WithEvents m_CloseTimer As New Timer()

Public Sub New()
Me.Text = "Spash form"
End Sub

Private Sub Form_Load( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Load
m_CloseTimer.Interval = 1000
m_CloseTimer.Enabled = True
End Sub

Private Sub m_CloseTimer_Tick( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles m_CloseTimer.Tick
m_CloseTimer.Enabled = False
Program.Context.MainForm = New MainForm()
Me.Close()
Program.Context.MainForm.Show()
End SUb
End Class

Public Class MainForm
Inherits Form

Public Sub New()
Me.Text = "Main form"
End Sub
End Class
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
Ben,

As alternative for the method showed by Herfried.

Instead of making your splash form your mainform, I use always one mainform,
that one starts by instance in the load event my splash screen as
\\\
dim splash as new splashform
splash.show
....do actions eventualy with a threading.thread.sleep(x)
splash.close
///

In the VBNet form class is build in (as it was in VB6) an automatic sub main

You can set that mainform in your application properties with setting the
startup object

I hope this helps,

Cor
Nov 21 '05 #4
Ben
Thanks a lot for the helps guys, I got it works.

"Cor Ligthert [MVP]" wrote:
Ben,

As alternative for the method showed by Herfried.

Instead of making your splash form your mainform, I use always one mainform,
that one starts by instance in the load event my splash screen as
\\\
dim splash as new splashform
splash.show
....do actions eventualy with a threading.thread.sleep(x)
splash.close
///

In the VBNet form class is build in (as it was in VB6) an automatic sub main

You can set that mainform in your application properties with setting the
startup object

I hope this helps,

Cor

Nov 21 '05 #5

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

Similar topics

1
by: Victor Irzak | last post by:
Hello, I have a g++-3.3.1 compiler (latest). I can't figure the type of endl, ends, flush. Here is my program. It compiles with VS.NET, Intel C++ compiler, but not with g++. If you can...
4
by: jay | last post by:
I was told that an ostringstream should be terminated by ends. However, the following code snippet does not do what I would expect if that were the case: #include <iostream> #include...
4
by: Tempy | last post by:
I am not a programmer, but love to dabble with VBA, mainly in Excel, but I have made an Access data base which is getting a bit outa hand for me!! I am using it to display information only; as a...
2
by: Jeffrey Palermo, MCAD.Net | last post by:
I have some classes that control file processing in c#. The files come from a mainframe and may take some time for each to process. I use the Threadpool to process multiple files at once. Each...
6
by: rrowe | last post by:
Admittedly, I am new to VB.NET I have some real simple code that I am trying to run in VB.NET Friend Module xxx Friend F1 As Form1 ----------------- Public Sub Main()
3
by: John Phelan-Cummings | last post by:
I have a front-end application called, “inbusiness.mdb” and three back-ends databases called, “inbusinessClient_be.mdb”, “inbusinessFund_be.mdb”, and, “inbusiness_be”. I created three back-ends...
5
by: Arno | last post by:
reposted with the right microsoft managed newsgroup ID: Sorry for the inconvinience Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable...
2
by: ForrestPhoto | last post by:
I would think it should disappear on its own when the application ends - if you have a main form and others, they'll all close when the user kills the main form. In any case, I override the...
0
by: tavares | last post by:
------------------------------------------------------------------------------------------------------------------------------------------- (Apologies for cross-posting) Symposium...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.