Python??C++????
???????????? ???????[ 2014/10/24 10:49:21 ] ??????????????? C++ Python
????OS??Win8.1 with update??
????1.????swig??http://www.swig.org/download.html
????2.??swig??·??????????????Path??????set path=C:swigwin-3.0.2??
????3.??VS???????win32 console application???MyApp??????????????????????MyApp.exe??
????4.??MyApp?????????????????win32 dll????????????????MyDll??????????MyDll.dll??
????5.??MyApp?????????????????win32 dll????????MyPython??
????6.???????????????MyApp??????MyDll??MyPython??????MyDll??
????7.???CMyDll?????????£?
MyDll.h
#pragma once
#include <string>
using namespace std;
#ifdef MYDLL_EXPORTS
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif
// This class is exported from the MyDll.dll
class MYDLL_API CMyDll {
public:
CMyDll(void);
virtual ~CMyDll() {}
string SayHello(string name);
double add(double i?? double j);
virtual string location();
};
MyDll.cpp
#include "stdafx.h"
#include "MyDll.h"
CMyDll::CMyDll()
{
return;
}
string CMyDll::SayHello(string name)
{
return "Hello " + name + ". I'm from " + location() + ".";
}
double CMyDll::add(double i?? double j)
{
return i + j;
}
string CMyDll::location()
{
return "C++";
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11