动态链接库怎么用

来源:百度知道 编辑:UC知道 时间:2024/06/27 06:13:48
我是新手,不怎么懂。现在老师让用动态链接库来对一幅图片进行缩略,然后可以根据原图地址复原原图。请问怎么弄?我还没有弄明白老师的意思。谢谢各位大虾,请帮忙指点一下
有什么好的函数可以对图像进行缩略,然后还可以根据原图的地址复原原图
如何做缩略图

动态连接库的创建步骤:

一、创建Non-MFC DLL动态链接库

1、打开File —> New —> Project选项,选择Win32 Dynamic-Link Library —>sample project

—>工程名:DllDemo

2、新建一个.h文件DllDemo.h

#ifdef DllDemo_EXPORTS

#define DllAPI __declspec(dllexport)

#else

#define DllAPI __declspec(dllimport)

extern "C" //原样编译

{

DllAPI int __stdcall Max(int a,int b); //__stdcall使非C/C++语言内能够调用API

}

#endif

3、在DllDemo.cpp文件中导入DllDemo.h文件,并实现Max(int,int)函数

#include "DllDemo.h"

DllAPI int __stdcall Max(int a,int b)

{

if(a==b)

return NULL;

else if(a>b)

return a;

else

return b;

}

4、编译程序