PC Review


Reply
Thread Tools Rate Thread

Application exiting before doing what it should do

 
 
John
Guest
Posts: n/a
 
      6th Jul 2008
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


 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      6th Jul 2008
"John" <(E-Mail Removed)> schrieb
> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exiting an ASP.net application =?Utf-8?B?YmJkb2J1ZGR5?= Microsoft ASP .NET 1 24th Jun 2005 04:59 PM
Win Application not exiting =?Utf-8?B?TURC?= Microsoft Dot NET 0 31st May 2004 07:51 PM
Exiting Application imbd4a Microsoft Access 6 7th Feb 2004 07:20 PM
Exiting an application Andrew Warren Microsoft C# .NET 8 5th Jan 2004 02:26 AM
Exiting an Application in VB.net tt Microsoft VB .NET 2 25th Sep 2003 06:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:30 PM.