I've got a dll, which exports function, which looks like this: MyClass::MyMethod(char*)
.
How do I use that through DllImport?
You use DllImport, like this:
[DllImport("MyNativeC++DLL.dll")]
private static extern void MyMethod(StringBuilder myCharPointerParameter);
If MyClass::MyMethod
is static, it can be exported and p/Invoked with ease (see Eric's answer).
If this is an instance method, things get a whole lot more difficult. How to Marshal a C++ Class.