473,805 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application.Run (frmMain)

Whats the purpose of

Application.Run (frmMain) in the Sub Main method.

Why not just...

Dim fMain as New frmMain
frmMain.Show()

???
Nov 22 '05 #1
3 3114
"D Witherspoon" <dw**********@n oway.org> schrieb:
Whats the purpose of

Application.Run (frmMain) in the Sub Main method.

Why not just...

Dim fMain as New frmMain
frmMain.Show()


Documentation on 'Application.Ru n':

| Begins running a standard application message loop on the
| current thread.

Showing a form by calling its 'Show' method doesn't do that.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 22 '05 #2

"D Witherspoon" wrote:
Whats the purpose of

Application.Run (frmMain) in the Sub Main method.

Why not just...

Dim fMain as New frmMain
frmMain.Show()

???


It's used to set up the main message loop on the current thread. The message
loop is what handles incoming messages from windows (mouse was clicked, mouse
was moved etc) and turns them into events that you can handle.
Without it once the sub main has finished your application exits.

James

Nov 22 '05 #3
Application.Run (), begins running a standard application message loop on the
current thread taking as parameter the form that's going to be the main
entry point of your application. In change, the way you say only creates an
instance of a form, quicky display it and the exits.

Hope this may help you,

Regards,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda

"D Witherspoon" <dw**********@n oway.org> wrote in message
news:O$******** ******@TK2MSFTN GP12.phx.gbl...
Whats the purpose of

Application.Run (frmMain) in the Sub Main method.

Why not just...

Dim fMain as New frmMain
frmMain.Show()

???

Nov 22 '05 #4

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

Similar topics

0
1838
by: MDB | last post by:
I have a strange problem. I recently made the leap from VB6 to VB.NE I built a simple test Windows application with 2 forms that logs into an Accounting system using its COM control. The reference to the accounting program is something like this Dim AccpacSession As New AccpacCOMAPI.AccpacSessio AccpacSession.Init("", "AR", "AR1100", "51A" AccpacSession.Open("ADMIN", "ADMIN", "SAMINC", System.DateTime.Now, 0, "" This works in VB6 and...
4
1390
by: W Hoover | last post by:
I have a problem I can't find a solution for. I have given my users the ability to restart the application from the File menu. I don't know how to re-invoke the sub main() in my .vb module -- in the sub main, I do the following: Dim frmSignon As New frmSignon frmSignon.ShowDialog() Application.Run(New frmMain) First, am I invoking my application properly (I call the frmSignon first,
3
402
by: D Witherspoon | last post by:
Whats the purpose of Application.Run(frmMain) in the Sub Main method. Why not just... Dim fMain as New frmMain frmMain.Show() ???
6
20088
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are quite a few words in this post but the questions are actually quite similar and should be fairly quick to answer ... (1) What is Happening with the Threads
12
4292
by: Dean Slindee | last post by:
My project has a main form (frmMain, the startup object for the project) and several other "child" forms that are painted within a large panel on frmMain. In each form's Form_Load event, a Weak Reference for that form is loaded into a global Hash table, like this: Dim wr As WeakReference = New WeakReference(Me, False) If Not hashTable.Contains(cfrmMain) Then
0
937
by: marcmc | last post by:
This is kinda hard to explain so here goes. I have a project as follows... I don't wont a web service or a console service application. 1st interface (SQL Server) Nightly Load to data warehouse finishes. My new polling trigger kicks in as follows: i.) Checks to see if MIS Run has finished successfully. If YES, goto next job step and trigger a MISRECON Routine. If NO, terminate program.
6
2105
by: ahmad.humyn | last post by:
I have an application in which the main form goes something like: public frmMain() { frmA frm = new frmA(); frm.show(); this.hide(); } Now that the control has been passed to frmA, how do I close the
13
6917
by: Garry | last post by:
Why is it that my installation od vs2005 will not accept My.Application.OpenForms saying that it is not part of My.Application??? Dim frm As Form For Each frm In My.Application.OpenForms Next frm Garry
0
9718
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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
10369
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
9186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
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...
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.