????????????????????
??????1????VS2010?????->???->????????Win32???
??????2????????????“Win32Dll”????????????????????????Dll??????????????????????????
???????????????Dll???????????????Dll???д?????????????????????????C++?????д??????????????д?????????????????
????1.??Win32Dll.h?е???CWin32Dll ??????

 

class WIN32DLL_API CWin32Dll {
public:
CWin32Dll(void);
// TODO: ???????????????
private:
int m_nVar;
std::string m_strVar;
public:
void set(int );
void printfValue();
void set_str(const std::string &);
void printf_str();
};
extern WIN32DLL_API int nWin32Dll;
//????????????????????????????????
WIN32DLL_API void printfValue(const int &);
WIN32DLL_API int fnWin32Dll(void);

????2.????????????????????????????????????????Win32Dll.cpp?е???????

 

CWin32Dll::CWin32Dll()
{
return;
}
void CWin32Dll::set(int v)
{
m_nVar = v;
}
void CWin32Dll::printfValue()
{
std::cout << m_nVar << std::endl;
}
void CWin32Dll::set_str(const std::string &str)
{
m_strVar = str;
}
void CWin32Dll::printf_str()
{
std::cout << m_strVar << std::endl;
}
void printfValue(const int &v)
{
std::cout << v << std::endl;
}

?????????????????????б?????????????Debug?????????????????.Dll?????.lib???