Calling DLL Fuinctions
-
I developed a windows-based application in C# ,there is a browse button, a textbox and a treeview control on the window, when i click on the browse button i can import managed DLL, the treeview control can display the classes, methods and methods parameter inside the DLL in a tree form, i want to call anyone of the method in a class in DLL at runtime,it is okay for static method but not okay for non-static method, I used MethodBase.Invoke(object,params) for this. Please help me so that i can create an object of the specified class and and also call that class method with the help of that class object at runtime in C#. Thanks.
-
I developed a windows-based application in C# ,there is a browse button, a textbox and a treeview control on the window, when i click on the browse button i can import managed DLL, the treeview control can display the classes, methods and methods parameter inside the DLL in a tree form, i want to call anyone of the method in a class in DLL at runtime,it is okay for static method but not okay for non-static method, I used MethodBase.Invoke(object,params) for this. Please help me so that i can create an object of the specified class and and also call that class method with the help of that class object at runtime in C#. Thanks.
You can use Assembly.CreateInstance(typeName) to create an instance of a type in an assembly, and from there you can invoke methods on that instance.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Christian Zionism, as seen from a Jewish perspective The apostle Paul, modernly speaking: Epistles of Paul Judah Himango