// Copyright (C) 2011 Fog Creek Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#include <initguid.h>
#include "THgShell_h.h"
#include "THgShell_i.c"
#include "TortoiseUtils.h"
#include "StringUtils.h"
#include "TortoiseHgCmenu.h"
#include "TortoiseHgDropHandler.h"
#include "TortoiseHgOverlay.h"
#include "TortoiseHgKeyboard.h"
#include "TortoiseHgCopyHook.h"
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_TortoiseHgCmenu, CTortoiseHgCmenu)
OBJECT_ENTRY(CLSID_TortoiseHgDropHandler, CTortoiseHgDropHandler)
OBJECT_ENTRY(CLSID_TortoiseHgNormal, CTortoiseHgNormal)
OBJECT_ENTRY(CLSID_TortoiseHgAdded, CTortoiseHgAdded)
OBJECT_ENTRY(CLSID_TortoiseHgModified, CTortoiseHgModified)
OBJECT_ENTRY(CLSID_TortoiseHgUnversioned, CTortoiseHgUnversioned)
OBJECT_ENTRY(CLSID_TortoiseHgKeyboard, CTortoiseHgKeyboard)
OBJECT_ENTRY(CLSID_TortoiseHgCopyHook, CTortoiseHgCopyHook)
END_OBJECT_MAP()
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
ATLTRACE("DllMain: DLL_PROCESS_ATTACH\n");
_Module.Init(ObjectMap, hInstance, &LIBID_THgShell);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
ATLTRACE("DllMain: DLL_PROCESS_ATTACH\n");
_Module.Term();
}
return 1;
}
STDAPI DllCanUnloadNow(void)
{
ATLTRACE("DllCanUnloadNow\n");
return _Module.GetLockCount() == 0 ? S_OK : S_FALSE;
}
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
ATLTRACE("DllGetClassObject\n");
return _Module.GetClassObject(rclsid, riid, ppv);
}
STDAPI DllRegisterServer(void)
{
ATLTRACE("DllRegisterServer\n");
return _Module.RegisterServer();
}
STDAPI DllUnregisterServer(void)
{
ATLTRACE("DllUnregisterServer\n");
return _Module.UnregisterServer();
}
|
Loading...