MFC创建DLL
2015-07-14 16:52
162 查看
pythondll.h文件
#ifndef _PYTHONDLL_H_
#define _PYTHONDLL_H_
#ifdef BUILD_DLL
#define OS_API __declspec(dllexport) //如果是生成dll工程,那么导出
#else
#define OS_API __declspec(dllimport) //如果是生成使用dll的工程,那么导入
#endif
class OS_API TestLib{
public:
void
display();
void
display(int a);
};
#endif
pythondll.cpp文件
#include <iostream>
//#include "python.h"
#include "pythondll.h"
using namespace std;
#ifdef __cplusplus
extern "C" {
#endif
void TestLib::display() {
cout<<"First display"<<endl;
}
void TestLib::display(int a) {
cout<<"Second display"<<endl;
}
#ifdef __cplusplus
}
#endif
#ifndef _PYTHONDLL_H_
#define _PYTHONDLL_H_
#ifdef BUILD_DLL
#define OS_API __declspec(dllexport) //如果是生成dll工程,那么导出
#else
#define OS_API __declspec(dllimport) //如果是生成使用dll的工程,那么导入
#endif
class OS_API TestLib{
public:
void
display();
void
display(int a);
};
#endif
pythondll.cpp文件
#include <iostream>
//#include "python.h"
#include "pythondll.h"
using namespace std;
#ifdef __cplusplus
extern "C" {
#endif
void TestLib::display() {
cout<<"First display"<<endl;
}
void TestLib::display(int a) {
cout<<"Second display"<<endl;
}
#ifdef __cplusplus
}
#endif
相关文章推荐
- 线性表
- Directshow中的Sample时间戳(Time Stamp)
- 在android上使用ASCII显示特殊符号
- python 文件操作 中文编码
- ES6 中的生成器函数介绍
- location 结构
- 快速幂取余 [转]
- Java基础--异常--自定义异常
- 7 天玩转 ASP.NET MVC - 第 1 天
- xml解析工具-jdom
- GRE写作必备句型
- java中的static关键字
- 重温stm32
- Spark分析SRS日志,以及Zookeeper和Kafka备忘录
- 【Cocos2d-js官方文档】 五、Cocos2d-JS v3.0的新Action API
- 面试题43:n个骰子的点数
- 音频采用率
- 笔试——题库汇总(阿里)
- spring mvc + proxool 配置
- java静态变量在方法区,只有1份