I have a C++ DLL with some exported functions. One of the exported functions is a function which builds and returns a pointer to an instance of a class. I have the header (.h) of this class so I know exactly what are its methods. However, the methods of this class are not exported in the DLL.
My goal is to build a wrapper DLL which will use some functions from the other DLL. This new DLL should be able to be called from Java with JNA or C# with P/Invoke.
Is it possible to call the methods of this object ? And if it is, how should I proceed ?
I tried to simply do this:
MyObject* myObject = GetMyObject();
myObject->callMethod();
I'm able to compile my DLL, however, it crashes when I use it in a program (the callMethod() crashes, not the GetMyObject()).
Edit: I have checked that myObject is not null, and my DLL and the other are both built with MSVC, though the versions may not be same.