vcfnewclasswiz.cpp

来自「这是VCF框架的代码」· C++ 代码 · 共 95 行

CPP
95
字号
// VCFNewClassWiz.cpp : Defines the initialization routines for the DLL.//#include "stdafx.h"#include "resource.h"#include <initguid.h>#include <afxdllx.h>#include <initguid.h>#include "VCFNewClassWiz.h"#include "VCFNewClassWizAddin.h"CComModule _Module;BEGIN_OBJECT_MAP(ObjectMap)	OBJECT_ENTRY(CLSID_VCFNewClassWiz, CVCFNewClassWiz)END_OBJECT_MAP()#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endifstatic AFX_EXTENSION_MODULE VCFNewClassWizDLL = { NULL, NULL };/////////////////////////////////////////////////////////////////////////////// DLL Entry Pointextern "C" int APIENTRYDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved){	UNREFERENCED_PARAMETER(lpReserved);	if (dwReason == DLL_PROCESS_ATTACH)	{		TRACE0("VCFNEWCLASSWIZ.DLL Initializing!\n");				if (!AfxInitExtensionModule(VCFNewClassWizDLL, hInstance))			return 0;		if ( !AfxInitRichEdit() )			return 0;		new CDynLinkLibrary(VCFNewClassWizDLL);     _Module.Init(ObjectMap, hInstance, &LIBID_VCFNEWCLASSWIZLib);     DisableThreadLibraryCalls(hInstance);	}	else if (dwReason == DLL_PROCESS_DETACH)	{		TRACE0("VCFNEWCLASSWIZ.DLL Terminating!\n");		AfxTermExtensionModule(VCFNewClassWizDLL);       _Module.Term();	}	return 1;}/////////////////////////////////////////////////////////////////////////////// Used to determine whether the DLL can be unloaded by OLESTDAPI DllCanUnloadNow(void){    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;}/////////////////////////////////////////////////////////////////////////////// Returns a class factory to create an object of the requested typeSTDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv){    return _Module.GetClassObject(rclsid, riid, ppv);}/////////////////////////////////////////////////////////////////////////////// DllRegisterServer - Adds entries to the system registrySTDAPI DllRegisterServer(void){    // registers object, typelib and all interfaces in typelib    return _Module.RegisterServer(TRUE);}/////////////////////////////////////////////////////////////////////////////// DllUnregisterServer - Removes entries from the system registrySTDAPI DllUnregisterServer(void){    return _Module.UnregisterServer(TRUE);}

⌨️ 快捷键说明

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