I load my dll in C# with
Assembly assembly = Assembly.LoadFrom(dllPath); // late binding
Type classType = assembly.GetType("Namespace.Classname");
object readerInterface = Activator.CreateInstance(classType);
but how can I access to my methods/members in readerInterface without
type.InvokeMember("Methodname", BindingFlags.InvokeMethod |
BindingFlags.Instance | BindingFlags.Public, null, readerInterface, null);
–> in form of readerInterface.write(); ???
Thank you very much!
greets leon22
assuming that you can’t just reference the assembly in your project C#… have the C++/CLI object implement an interface and cast it to that interface, then just use it as normal.
1) declare your interface in C# using whatever methods are appropriate
2) Implement the interface on your C++/CLI object
3) cast the object that you created through reflection to that interface