C 如何写DLL,如果您有资料请分享下。
我想用C写DLL。DLL。
谁有DLL的资料。
写了DLL又如何调用。
[[it] 本帖最后由 cosdos 于 2008-2-12 22:37 编辑 [/it]]
----------------解决方案--------------------------------------------------------
帮你顶一下.
----------------解决方案--------------------------------------------------------
我也帮你顶一下,动态连接库我只看我同学写过,我也没有资料。。。
----------------解决方案--------------------------------------------------------
这个好象以前经常看到的 可惜不知道是在哪一本书里了 帮你找找。。。
----------------解决方案--------------------------------------------------------
给你看从csdn里面找来的一段例子
//head file: asd.h
#ifdef _cplusplus
extern "C"{
#else
#endif
#ifdef HEAD_DLL
#define DLL_EXPORT _declspec(dllexport)
#else
#define DLL_EXPORT
#endif
int DLL_EXPORT asd_main(char* file_in, char* file_out);
#ifdef _cplusplus
}
#endif
//C file: asd.c
#include "asd.h"
int DLL_EXPORT asd_main(char* file_in, char* file_out)
{
FILE *in, *out;
in = fopen(file_in,"rb");
if(in == NULL)
return 0;
out = fopen(file_out,"wb");
if(out == NULL)
return 0;
//add code what you want:
......
}
然后编译的时候用一个生成dll的参数
----------------解决方案--------------------------------------------------------