本文共 713 字,大约阅读时间需要 2 分钟。
http://blog.sina.com.cn/s/blog_4ac0a0d30100qlec.html
//**********工程1 dll************//精简dll lib.cpp#include "windows.h"#include "stdio.h"int _stdcall add(int x,int y){ return x + y;}char* _stdcall msg(char *words){ static char buffer[]="ddddddddddddddddddd"; return buffer;}//精简dll lib.defLIBRARY LIBEXPORTSadd @ 1msg @ 2//************工程2 调用dll******************//精简dll 调用#includetypedef char* (__stdcall *dFunc)(char *words);main(){ HINSTANCE dHand; dFunc mess; dHand=::LoadLibrary("K:\\mess.dll"); printf("%d",dHand); mess=(dFunc)::GetProcAddress(dHand,"message"); mess("abc"); ::FreeLibrary(dHand); }
mfc Dll 一样的可以参考
http://wenku.baidu.com/view/256bebf3f90f76c661371abb.html###
1.在Class增加函数
2.def中声明
转载地址:http://ungpb.baihongyu.com/