您的位置:首页 > 其它

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: