simpledll.c

来自「图像处理的压缩算法」· C语言 代码 · 共 39 行

C
39
字号

#include <windows.h>

/*
DllMain is an optional method of entry into a dynamic-link library (DLL).
If the function is used, it is called by the system when processes and threads
are initialized and terminated, or upon calls to the LoadLibrary and
FreeLibrary functions.
*/
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;
}


__declspec(dllexport) int IncrementMatrix(double *pdMatrix, int iRows, int iCols, double dIncAmount)
{
	int iRow, iCol;

	for( iRow = 0; iRow < iRows; iRow++ )
	{
		for( iCol = 0; iCol < iCols; iCol++ )
		{
			*pdMatrix += dIncAmount;
			pdMatrix++;
		}
	}

	return 0;
}

⌨️ 快捷键说明

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