hedandb.cpp

来自「深入浅出Visual C++入门进阶与应用实例 随书光盘 作者 何志丹」· C++ 代码 · 共 38 行

CPP
38
字号
// HeDanDB.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include <afxdllx.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


static AFX_EXTENSION_MODULE HeDanDBDLL = { NULL, NULL };

extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
	if(NULL == ghInstance)
		ghInstance = hInstance;
	
	if (dwReason == DLL_PROCESS_ATTACH)
	{
		TRACE0("HEDANDB.DLL Initializing!\n");		
		
		if (!AfxInitExtensionModule(HeDanDBDLL, hInstance))
			return 0;

		new CDynLinkLibrary(HeDanDBDLL);
	}
	else if (dwReason == DLL_PROCESS_DETACH)
	{
		TRACE0("HEDANDB.DLL Terminating!\n");
		AfxTermExtensionModule(HeDanDBDLL);
	}
	return 1;   
}

⌨️ 快捷键说明

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