Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reflection does not call the method
Message
From
20/06/2006 15:02:02
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Reflection does not call the method
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01130336
Message ID:
01130336
Views:
71
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
Next
Reply
Map
View

Click here to load this message in the networking platform