#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
__declspec(dllexport) int Calculate (const int x); //C++ language
//extern "C" int PASCAL EXPORT Calculate (const int x); // C language
4.编辑源代码文件helloworld.cpp,其内容如下:
#include "stdafx.h"
#include "helloworld.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// C++
__declspec(dllexport) int Calculate (const int x)
{
return 2*x;
}
// C language
/*extern "C" int PASCAL EXPORT Calculate (const int x)
{
return 2*x;
}*/