math.cpp

来自「Visual c++.程序设计培训教程」· C++ 代码 · 共 48 行

CPP
48
字号
// Math.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "Math.h"

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
			break;
    }
    return TRUE;
}


// This is an example of an exported variable
MATH_API int nMath=0;

// This is an example of an exported function.
MATH_API int fnMath(void)
{
	return 42;
}

// This is the constructor of a class that has been exported.
// see Math.h for the class definition
CMath::CMath()
{ 
	return; 
}

/////////////////////////////////////////////
//        用于求和的函数Add
MATH_API int Add(int a, int b)
{
	int  num = a + b; // 将两个整数求和
	
	return  num;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?