I am trying to (vs2015, c++) access the classes and methods of an external dll. I dont have the .h nor the .lib file of that dll. I can see from dumpbin.exe that the dll has following unmangled/mangled methods:
Controller::PositionAt(double,double)
?PositionAt@Controller@@UEAAXNN@Z
void MoveTo(double,double)
?MoveTo@@YAXNN@Z
class Controller * GetController(void)
?GetController@@YAPEAVController@@XZ
I can load the dll and use the MoveTo() function succesfully with:
typedef void(__stdcall *f_func) (double x, double y);
HINSTANCE hdl = LoadLibraryA("C:\\Plug-in.dll");
f_func func = (f_func)GetProcAddress(hdl, "?MoveTo@@YAXNN@Z");
func((double) 1,(double) 2);
But the PositionAt() function fails. It seems I have to load the Controller class first, which apparently I am able to, using:
typedef void * (__stdcall *MyController)(void);
static MyController Ptr_MyController = NULL;
Ptr_MyController = (MyController)GetProcAddress((HINSTANCE) hdl, (LPCSTR) "?GetController@@YAPEAVController@@XZ");
void* MyController;
MyController = Ptr_MyController();
But I am failing to understand how do use the method PositionAt() of this class.
Thanks in advance!