dll.cpp

来自「操作系统上机实验报告」· C++ 代码 · 共 28 行

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

#include "stdafx.h"

extern "C" int __declspec(dllexport) add(int x,int y);
extern "C" int __declspec(dllexport) sub(int x,int y);

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    return TRUE;
}

int add(int x,int y)
{
	int z;
	z=x+y;
	return z;
}
int sub(int x,int y)
{
	int z;
	z=x-y;
	return z;
}

⌨️ 快捷键说明

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