473,468 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Application exiting before doing what it should do

Hi

My app involves an Infragistics control but as problem seems to be more with
how vb.net works when using SUB Main so I am posting it here nevertheless. I
want my app to pick up the first command line argument, pass it to
infragistics desktop alert control to display and then exit. My code is
given below. Problem is that app exits as soon as it is run and desktop
alert does not get time to be displayed. However the same alert displays
fine if I use start-up form (instead of SUB Main) and use a button on form
to run the ShowDesktopAlert SUB.

What is the problem and how can I make it work using SUB Main?

Thanks

Regards
Module modMain
Friend WithEvents dalMain As New Infragistics.Win.Misc.UltraDesktopAlert

Sub Main(ByVal sArgs() As String)
Dim Tel As String = ""
Dim Caption As String = ""

If sArgs.Length 0 Then
Tel = sArgs(0)
Caption = "Incoming Staff call " & Tel
ShowDesktopAlert(Caption, "Goto contact?")
End If
End Sub

Sub ShowDesktopAlert(ByVal Caption As String, ByVal Msg As String)
dalMain.Show(Caption & ":" & Msg, "Click here to go to contact
record.")
Application.DoEvents()
End Sub

End Module
Jul 6 '08 #1
1 1369
"John" <in**@nospam.infovis.co.ukschrieb
Sub ShowDesktopAlert(ByVal Caption As String, ByVal Msg As
String)
dalMain.Show(Caption & ":" & Msg, "Click here to go
to contact record.")
Application.DoEvents()
End Sub

End Module
Is dalMain a Form? If it is, replace
application.doevents
with
application.run(dalMain)

This makes the app close after dalMain has been closed. If it's not a
Form...(taken from their homepage it seems to be a component)..., you should
call Application.Run() without args. Then, call Application.ExitThread
whenever you want the app to close.
Armin

Jul 6 '08 #2

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

Similar topics

5
by: The Roys | last post by:
Hi Im doing something wrong in quitting the Word.Application in my VB program. I have General Declarations Dim AppWord As Word.Application Form_Load() Set AppWord =...
8
by: Andrew Warren | last post by:
I'm trying to exit a Windows Forms application while in the form's constructor (after InitializeComponent() has been called) and am finding that calling Application.Exit () still leaves the form...
1
by: lpinho | last post by:
Hi there C# experts, I'm building a C# windows applications that loads some OCX (made using VB 6), I'm able to load the OCX and then dispose it (at least apparently), but when I'm exiting my C#...
7
by: Ralf Gedrat | last post by:
Hello! I have some Vb.Net applications, which are terminated at indefinite times without message. If I call in the program regulated system.GC.Collect, then the program is terminated here...
20
by: Peter Oliphant | last post by:
How does one launch multiple forms in an application? Using Photoshop as an example, this application seems to be composed of many 'disjoint' forms. Yet, they all seem somewhat 'active' in...
6
by: Aart Nicolai | last post by:
Hi all, I have developed a vb.net console application which will run some code every seconds. To get this working I used a timer "System.Timers". When I start my console application it exits...
6
by: Ant | last post by:
Hi all, I'm putting together a simple help module for my applications, using html files stored in the application directory somewhere. Basically it sets up a basic web server, and then uses the...
2
by: jrpfinch | last post by:
Is the following the most elegant way to exit a multi-threaded application on a Ctrl-C? I am a complete beginner and would have thought there was some way of doing it without having to use while...
15
by: =?Utf-8?B?TVNU?= | last post by:
To demonstrate my problem, I have a very simple VB Windows application. It has a text box that is used to display a counter, a button to reset the counter, and a timer that increments the counter...
4
by: federico | last post by:
Hello, I am trying to setup a Visual Basic "Console" application for searching Outlook folders. To this end I am trying to implement a Handler for the Outlook.Application.AdvancedSearchComplete...
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...
0
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...
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
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...
1
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...
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.