473,770 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1371
Do you have Application.Run call in your main?

HTH
Alex
"Ben" <Be*@discussion s.microsoft.com > wrote in message
news:2A******** *************** ***********@mic rosoft.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*@discussion s.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 ApplicationCont ext

Public Sub Main()
Context = New ApplicationCont ext()
Context.MainFor m = New SplashForm()
Application.Run (Context)
End Sub

Public Property Context() As ApplicationCont ext
Get
Return m_Context
End Get
Set(ByVal Value As ApplicationCont ext)
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.In terval = 1000
m_CloseTimer.En abled = True
End Sub

Private Sub m_CloseTimer_Ti ck( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles m_CloseTimer.Ti ck
m_CloseTimer.En abled = 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.threa d.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.threa d.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
4661
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 compile it using some other type, please post the type used.
4
2068
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 <sstream> using namespace std;
4
1621
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 project report. I have three sections that I must report on, namely: General information Purchasing issues & Quality issues.
2
2443
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 instance of the file processor is spawned in its own AppDomain to isolate it (I'm using a separate AppDomain for a valid reason, so this thread isn't to discuss that). My process is a Windows service, but I can duplicate this problem as a regular...
6
1263
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
1822
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 for the potential intensive use of certain areas of the front-end application to their back-end tables by certain type of organizations. With the code below, (used to make future front-end updates
5
15727
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 to read data from the transport connection" when restart reading the stream with socket.BeginRead in the Sub SocketIncomingMsg. I'm debugging now for weeks, but I can't detect where it's
2
2235
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 OnClosing method and set notifyicon1.Visible = false, but still, after my program ends, the icon is left behind in the notification area. I've seen the same thing pretty often with SQL Server Management Studio 2005. Is this just a bug inherent to...
0
1206
by: tavares | last post by:
------------------------------------------------------------------------------------------------------------------------------------------- (Apologies for cross-posting) Symposium "Computational Methods in Image Analysis" National Congress on Computational Mechanics (USNCCM IX) San Francisco, CA, USA, July 22 - 26 2007 http://www.me.berkeley.edu/compmat/USACM/main.html We would appreciate if you could distribute this information by...
0
10254
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.