c++创建DLL

来源:互联网 发布:js cookie 代码 编辑:程序博客网 时间:2024/06/03 10:53


新建-项目-win32项目-dll,空项目--新建mydll.h,mydll.cpp,mydll.def文件


mydll.cpp

#include "mydll.h"
#include <stdio.h>
int Min(int a,int b)
{
printf("Min is called ");
if(a>=b) 
return b;
else
return a;
}


int _stdcall Max(int a,int b)
{
return a;
}


mydll.h


extern "C" _declspec(dllexport) int Min(int a,int b);

extern "C" int _declspec(dllexport) __stdcall Max(int a,int b);



mydll.def

LIBRARY "mydll"
EXPORTS
Max @1 

原创粉丝点击