⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lib.cpp

📁 dll的一些学习资料
💻 CPP
字号:
#include "lib.h"
#include "windows.h"
#include "stdio.h"
// lib.cpp : 采用_stdcall修饰导出函数

BOOL APIENTRY DllMain( HANDLE hModule, 
					  DWORD  ul_reason_for_call, 
					  LPVOID lpReserved
					  )
{
    switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		printf("\nprocess attach of dll");
		break;
	case DLL_THREAD_ATTACH:
		printf("\nthread attach of dll");
		break;
	case DLL_THREAD_DETACH:
		printf("\nthread detach of dll");
		break;
	case DLL_PROCESS_DETACH:
		printf("\nprocess detach of dll");
		break;
    }
    return TRUE;
}
//用任何一种方法输出函数时,确保用_stdcall调用约定, _stdcall 调用约定是用来调用Win32 API函数。
//_stdcall 以相反的顺序(从右到左) 把参数推入栈中
int _stdcall add(int x,int y)
{
	return x + y;
}

⌨️ 快捷键说明

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