The export class solution has some serious drawbacks. You cannot write DLLs in other languages ββbecause they do not support name management. In addition, you cannot use other compilers except VS (for the same reason). In addition, you cannot use another version of VS, because MS does not guarantee that the carriage mechanism remains unchanged in different versions of the compiler.
I would suggest using a flattened C-style interface, for example.
MyClass::Method(int i, float f);
Export as:
MyClass_MyMethod(MyClass * instance, int i, float f);
You can wrap it inside C # to create a class again.
Spook source share