?? testdll.cpp
字號:
// TestDll.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "TestDll.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
TESTDLL_API int nTestDll=0;
// This is an example of an exported function.
TESTDLL_API int fnTestDll(void)
{
return 42;
}
// This is the constructor of a class that has been exported.
// see TestDll.h for the class definition
CTestDll::CTestDll()
{
return;
}
__declspec(dllexport) int Add(int n1, int n2)
{
return n1 + n2;
}
__declspec(dllexport) int Sub(int n1, int n2)
{
return n1 - n2;
}
__declspec(dllexport) int Mul(int n1, int n2)
{
return n1 * n2;
}
__declspec(dllexport) int Div(int n1, int n2)
{
return n1 / n2;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -