????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++";
}