文章作者:里海
来源网站:https://blog.csdn.net/WangPaiFeiXingYuan
简介:
加载dll并调用dll中的函数
效果:
DLL库代码:
extern "C" __declspec(dllexport) //从本DLL导出,给其它程序用。
int Add(int a, int b)
{
return a + b;
}
int Subtract(int a, int b)
{
return a - b;
}
调用测试代码:
#include <sstream>
#include <iomanip>
#include <iostream>
#include <Windows.h>
using namespace std;
// 动态调用DLL
int Add(int a, int b)
{
typedef int(*AddFunc)(in