dll interface specification and includes
Hi.
I have a dll I've written in visual studio 2005 standard.
It has a bunch of functions that are defined similarily to this
in a header:
__declspec(dllexport) int LoadStuff(int & parm1, char * parm2);
__declspec(dllexport) int UnLoadStuff(void);
Now, I load this library dynamically from another app developed in
another vendors older compiler.
There I have code like this in a header:
typedef int (* cdecl functionPointerLoadStuff)(int & parm1, char *parm2);
typedef int (* cdecl functionPointerUnLoadStuff)(void);
and in the same file I have this:
class myClass
{
public:
functionPointerLoadStuff functionLoadStuff;
functionPointerUnLoadStuff functionUnLoadStuff;
};
Finally in my class implementation I have code like this:
functionLoadStuff = (functionPointerLoadStuff )
GetProcAddress(hLibrary,"LoadStuff");
functionUnLoadStuff = (functionPointerUnLoadStuff)
GetProcAddress(hLibrary,"UnLoadStuff");
I'm wondering if there is some way to not have to maintain the header files
separately since in a sense they both code for the same interface. I'd rather
not have to separately update each one if at all reasonably possible.
I'm not so sure that the other vendors old compiler will recognize everything,
but I'm perusing the possibilities now.
Thanks
Jeff Kish