MFC創建DLL

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


發佈了28 篇原創文章 · 獲贊 3 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章