Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reflection does not call the method
Message
De
20/06/2006 15:02:02
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Reflection does not call the method
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01130336
Message ID:
01130336
Vues:
72
I have done this several times. But, today, when trying to run a simplified version of an approach to use Reflection to execute a method in the current class, I cannot find where is the problem. I have this code:
    Private Function ProcessTaskQuery() As Boolean
        Dim loParameter(0) As Object
        Dim loType As Type = Me.GetType()
        lcMethod = "Test"
        Dim loInfo As System.Reflection.MethodInfo = loType.GetMethod(lcMethod)
        loInfo.Invoke(Me, loParameter)
        Return True
    End Function

    Private Function Test() As Boolean
        MessageBox.Show("inside")
        Return True
    End Function
This method is among several other methods in the same class. When I execute this method, the goal is to be able to call a method. The process works ok until loInfo.Invoke() line is reached. When that line is reached, nothing happens. This one is really simple. I do not pass any parameter to the method. Me is the current class. Once loInfo.Invoke() line is executed, it should display a message box as this is what I have in the startup code of the Test() function. But, nothing happens.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform