在VS2008生成dll
1 选择new->project->win32 console project;
2 输入你的solution的名字->按下next->选择DLL->选择OK;
3 在工程中添加一个与工程名字同名的test.h文件,在文件中写入代码: extern "C" __declspec(dllexport) void AFunc(char *input); (文件名字是需要导出的文件名);
4 在cpp文件的头上其他include语句后面,添加#include "test.h",在其中写入你的函数声明void AFunc(char *input);
5 在build->batch build 中将都选中该project,编译
在VS2008动态调用dll
1 将被调用函数的DLL和.h文件放入调用函数的文件夹中。
2 在调用函数的cpp文件中添加
注: 如果LoadLibrary参数为"test.dll"则