Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There are multiple User defied dll files from which I need to extract Namespace, Class Names and Method Names and need to store in variables.

For example:

I have one file called MathLibrary.dll and it is placed at: C:\

Now I need some function that can get class names from it and store in variable.

public function getClass(dllFilePath)

end function

Note: Assume that we have only one class in dll file.

Now I need to extract all the methods from this class and need to set variables for this methods. See example below where we have Subtract method and given two parameters as input:

public function executeDLLMethod(class_Namespace, methodName,ParamString)

Dim myObj
Dim myClass
Set myObj = CreateObject(class_Namespace)

myObj.methodName()
end function

call executeDLLMethod("","Substract","10;5")

What I have tried:

I tried lot to get class names and methods from dll file using various methods. I was able to get all class names with ildasm.exe tool. However, I cannot use it as I need all the class names stored in a variable.
Posted
Updated 25-Apr-22 20:53pm

1 solution

Then you will have to use Reflection: Reflection - Visual Basic | Microsoft Docs[^]
 
Share this answer
 
Comments
Keyur Raval 2022 28-Apr-22 2:15am    
Thank you Griff!!
I was able to extract classes, methods and their parameters with the help of your answer.
Now again I want to use these classes, methods and their parameters in a C# program or visual basic program. My ultimate goal is to store class names and methods parameters in variable and run the dll. User can choose what method he want to execute.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900