2013年2月25日

摘要: //dll project.hView Code #ifdef DLL_TEST1_EXPORT#define DLL_DECLSPEC __declspec(dllexport)#else#define DLL_DECLSPEC __declspec(dllimport)#endifextern "C" DLL_DECLSPEC int WINAPI Add(int, int);DLL中导出函数的声明有两种方式:一种为4.1节例子中给出的在函数声明中加上__declspec(dllexport),这里不再举例说明;另外一种方式是采用模块定义(.def) 文件声明,.def 阅读全文
posted @ 2013-02-25 01:08 All IN 阅读(298) 评论(0) 推荐(0)
摘要: //static library projectlib.hView Code extern "C" int __cdecl Add(int, int);lib.cppView Code #include "lib.h"int __cdecl Add(int a, int b){ return a + b;}//App projectView Code #include <stdio.h>#include "..\\staticdll\\lib.h"#pragma comment(lib, "..\\debug\\ 阅读全文
posted @ 2013-02-25 00:15 All IN 阅读(130) 评论(0) 推荐(0)

导航