An open API service indexing awesome lists of open source software.

https://github.com/hw140701/dynamicmoduleloader

Load dynamic libraries on Windows and Linux platforms(Windows/Linux加载动态库封装类)
https://github.com/hw140701/dynamicmoduleloader

dynamic-module loader

Last synced: about 1 year ago
JSON representation

Load dynamic libraries on Windows and Linux platforms(Windows/Linux加载动态库封装类)

Awesome Lists containing this project

README

          

# 1 DynamicModuleLoader

DynamicModuleLoader is a C++ class that can load dynamic libraries on Windows and Linux platforms.

# 2 How to Use

```cpp
#include

#include "DynamicModuleLoder.h"
typedef int(*Func_Add)(int,int);

int main()
{
DynamicModuleLoder dllLoader;
if (dllLoader.LoadDynamicModule("add.dll"))
{
void* voidTest = dllLoader.GetFunction("Add");
if (voidTest != NULL)
{
Func_Add f_add = (Func_Add )(voidTest );
int ret = f_add(1,2);
std::cout << ret << std::endl;
}
else
{
std::cout << dllLoader.GetErrorMessage() << std::endl;
}
}
else
{
std::cout << dllLoader.GetErrorMessage() << std::endl;
}
dllLoader.UnloadDynamicModule();
getchar();

return 0;
}
```