#include "pch.h"
#include <iostream>
//system
#include <Windows.h>
//local
typedef int(*xj_TestAdd)(const int &a, const int &b); // 声明
typedef void(*xj_TestReadImage)(const std::string &imgPath, int &width, int &height);
HMODULE hm = LoadLibrary(L"xj.dll"); // 引用dll
int main()
{
if (hm != NULL)
{
int a = 11, b = 55;
xj_TestAdd xjAdd = (xj_TestAdd)GetProcAddress(hm, "xjTestAdd");
int sum = xjAdd(11, 55);
std::cout << a << " + " << b << " = " << sum << std::endl << std::endl;
std::string path = "F:/test.jpg";
int width = -3, height = -3;
xj_TestReadImage xjReadImage = (xj_TestReadImage)GetProcAddress(hm, "xjTestReadImage");
xjReadImage(path, width, height);
std::cout << "width = " << width << ", height = " << height << std::endl << std::endl;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
VS2017 C++ 生成dll并调用

共70个文件
tlog:14个
ipch:10个
cpp:5个


温馨提示
通过VS2017,生成dll项目,生成dll,并在另外程序中调用dll。....................
资源推荐
资源详情
资源评论










收起资源包目录



































































































共 70 条
- 1
资源评论

- weixin_410092452022-04-14缺文件,调不了。
- hymaliang11202021-11-18调用不起来

累了就要打游戏
- 粉丝: 1325
- 资源: 37
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


安全验证
文档复制为VIP权益,开通VIP直接复制
