Link to home
Start Free TrialLog in
Avatar of 4eyesgirl
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
ASKER CERTIFIED SOLUTION
Avatar of Anthony2000
Anthony2000
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial