Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access of shared members reference
Message
De
18/12/2005 20:41:41
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Access of shared members reference
Divers
Thread ID:
01079058
Message ID:
01079058
Vues:
48
I am trying to resolve a reference problem. Here is the code:
    Public Shared oApplication As System.Windows.Forms.Application

    ' Initialize
    Public Shared Function Initialize() As Boolean

        ' Startup directory
        Select Case Framework.App.nApplicationMode
            Case 1
                Framework.App.cStartupDirectory = Framework.App.oApplication.StartupPath + "\"
                Framework.App.cStartupDirectory = System.Windows.Forms.Application.StartupPath + "\"
            Case 2
                Framework.App.cStartupDirectory = Framework.App.oServer.MapPath("")
            Case 3
                Framework.App.cStartupDirectory = Framework.App.oServer.MapPath("")
        End Select

        Return True
    End Function
In Case 1, if I reference the full path for the StartupPath property by the use of System.Windows.Forms.Application, this works. But, if I try to initiliaze oApplication to be equal to System.Windows.Forms.Application, I can't use the first line in Case 1 because there is a reference problem. The message is:

Access of shared members, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.

What I don't understand is that Framework.App.oApplication does recognize StartupPath by the use of Intellisense. But, it does not want to accept it.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform