Dynamic library call function

What would be the best way, if possible, to load a dynamic library and call one of its functions if we do not know the function name at compile time?

For example, is there a way to make a program that reads a line from a file and then loads the DLL and looks for and calls a function with its name, which is the line read from the file?

Help would be greatly appreciated.

+6
c ++ function windows dynamic dll
source share
1 answer

Wikipedia has where it shows how to use LoadLibrary () at runtime. You will see that the function name is specified as a string. You will need to write code to search for the name of the function and pass it to a similar code.

On Linux, you can do this with the dlopen () and dlsym () functions .

+7
source share

All Articles