4eyesgirl
asked on
Want to create a wrapper class for dlopen, dlsym, dlclose to work on both UNIX and windows platform
I would like to create a wrapper class to dynamic load dll.
I know I need to at least support dlopen, dlsym, dlclose for UNIX
On windows, I believe LoadLibrary() == dlopen()
GetProcAddress() == dlsym()
and FreeLibrary() == dlclose()
Is this correct?
In LoadLibrary() windows function, it return HINSTANCE type.
In dlopen(), it return void*
So what is HINSTANCE type is?
I need some help to write this wrapper class, can someone provide a simple function, maybe just shows me how to write the wrapper function for dlopen and LoadLibrary()?
Also, what other functions I need to be cover in this wrapper other than the dlopen, dlclose, dlsym()? Did I miss anything?
What heppen if I called dlopen and never call dlcose? This question has nothing to do with my wrapper class, but I just want to under this a bit better.
Thanks.
4eyes
I know I need to at least support dlopen, dlsym, dlclose for UNIX
On windows, I believe LoadLibrary() == dlopen()
GetProcAddress() == dlsym()
and FreeLibrary() == dlclose()
Is this correct?
In LoadLibrary() windows function, it return HINSTANCE type.
In dlopen(), it return void*
So what is HINSTANCE type is?
I need some help to write this wrapper class, can someone provide a simple function, maybe just shows me how to write the wrapper function for dlopen and LoadLibrary()?
Also, what other functions I need to be cover in this wrapper other than the dlopen, dlclose, dlsym()? Did I miss anything?
What heppen if I called dlopen and never call dlcose? This question has nothing to do with my wrapper class, but I just want to under this a bit better.
Thanks.
4eyes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.codeproject.com/useritems/plat_ind_coding.asp