G
Guest
Hi
I've got loading assemblies dynamically done (wasn't too difficult). Now I want to lookup a static function in the loaded assembly, and if found, return it somehow, and call it from my app. So far, my efforts have failed miserably
My function takes custom objects as parameters, along the lines of: string MyFunction(XmlNode node, MyNamespace.MyObject myObject, String str) { ...
I've tried using delegates, and also MethodInfo, but neither seem to like me at present
I figured I could write a static helper function in my DLL which then returns a delegate wrapping the found static method in the DLL. I then used MethodInfo to find the helper function, and call it using Invoke(). Whilst the Invoke call itself succeeds, and returns the delegate, I can't cast it to my delegate type .. it always throws an exception
Regards
Jonathan Roewen
I've got loading assemblies dynamically done (wasn't too difficult). Now I want to lookup a static function in the loaded assembly, and if found, return it somehow, and call it from my app. So far, my efforts have failed miserably
My function takes custom objects as parameters, along the lines of: string MyFunction(XmlNode node, MyNamespace.MyObject myObject, String str) { ...
I've tried using delegates, and also MethodInfo, but neither seem to like me at present
I figured I could write a static helper function in my DLL which then returns a delegate wrapping the found static method in the DLL. I then used MethodInfo to find the helper function, and call it using Invoke(). Whilst the Invoke call itself succeeds, and returns the delegate, I can't cast it to my delegate type .. it always throws an exception
Regards
Jonathan Roewen