D
Domer
In my program, I load dynamically a DLL and I'm able to get a function
pointer of type "int (__cdecl *)(void)" of any function in the DLL.
If a DLL has a static class function, which calls the constructor and
returns a pointer to the constructed instance of the class, then I don't
have any problems.
However, if a DLL doesn't have such static function, then I can't get it
working. I'm able to get a function pointer to the class constructor,
but I have no idea how to call the constructor in the way that that it
also creates instance of the class (with 'operator new' obviously).
Calling just the constructor, of course, doesn't return a valid instance
of the class.
The header of the DLL is basically like this:
class dllclass
{
public:
__declspec(dllexport) virtual ~dllclass();
__declspec(dllexport) dllclass();
__declspec(dllexport) virtual void dosomething1();
__declspec(dllexport) virtual void dosomething2();
__declspec(dllexport) virtual void dosomething3();
};
I cannot change the DLL, so that kind of workaround isn't possible.
Any suggestions? Is it even possible? Thanks in advance.
pointer of type "int (__cdecl *)(void)" of any function in the DLL.
If a DLL has a static class function, which calls the constructor and
returns a pointer to the constructed instance of the class, then I don't
have any problems.
However, if a DLL doesn't have such static function, then I can't get it
working. I'm able to get a function pointer to the class constructor,
but I have no idea how to call the constructor in the way that that it
also creates instance of the class (with 'operator new' obviously).
Calling just the constructor, of course, doesn't return a valid instance
of the class.
The header of the DLL is basically like this:
class dllclass
{
public:
__declspec(dllexport) virtual ~dllclass();
__declspec(dllexport) dllclass();
__declspec(dllexport) virtual void dosomething1();
__declspec(dllexport) virtual void dosomething2();
__declspec(dllexport) virtual void dosomething3();
};
I cannot change the DLL, so that kind of workaround isn't possible.
Any suggestions? Is it even possible? Thanks in advance.