Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Startup program with application framework
Message
De
01/01/2006 16:34:30
 
 
À
30/12/2005 06:29:20
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01081950
Message ID:
01082349
Vues:
7
>This sounds like to obverse of what you were asking in the other thread. Basically, as you have found, you can have a Main() routine as a startup object OR use the Application object (which, in fact, has a hidden Main() method and thus explains why you can't do what you want).
>
>If you want to use the IDE Application approach then the CmdArgs are available in the parameters of the StartUp event and the form state can be modified after the .MainForm assignment in the OnCreateMainForm() method (but I've a feeling you're going to say you don't want code in the Application class<s>)

It seems to have gotten much more complicated to pass application parameters. The following code works well when I pass a parameter:
        Private Sub App_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
            Framework.App.oStartupEventArgs = e
            Framework.App.Initialize()
        End Sub

Public Class App
    Public Shared oStartupEventArgs As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs

    ' Initialize
    Public Shared Function Initialize() As Boolean

        ' Command line parameters
        If Framework.App.oStartupEventArgs.CommandLine.Item(0).Length > 0 Then
            If UCase(Framework.App.oStartupEventArgs.CommandLine.Item(0)) = "/AUTO" Then
            End If
        End If

    End Function

End Class
But, if I don't pass a parameter, the application crashes on the detection of the length of the command line parameters. I also tried to verify the presence of that object by the use of IsNothing. But, all access to the object makes the application to crash if I don't pass a parameter. What is the proper way to detect if a parameter has been passed now?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform