Commits

Stefan Rusek committed cb2caa8

Remove dependency on ATL by creating fakeatl.cpp and fakeatl.h

Comments (0)

Files changed (8)

 syntax: glob
+*.cache
 cutehg/views/ui_*.py
 cutehg/dialogs/ui_*.py
 shellext/_ReSharper*

win32/shellext/common.h

 #endif
 
 #include <windows.h>
+#include <tchar.h>
+
+#ifdef USE_REAL_ATL
 #include <atlbase.h>
 #include <atlcom.h>
+#else
+#include "fakeatl.h"
+#endif
 
 #include "resource.h"
 #include "cutehg_h.h"
 BOOL HgFindRoot(LPCWSTR path, string* root);
 void Hg(string* hg, LPCWSTR* cmd);
 
-struct MenuCommand;
-typedef HRESULT (CALLBACK *LPACTION)(const string&, const std::vector<string>*, const MenuCommand*);
-struct MenuCommand
-{
-	LPCSTR   showstatus;
-	LPCSTR   enablestatus;
-	LPCWSTR  verb;
-	LPCWSTR  text;
-	LPCWSTR  help;
-	LPCWSTR  cmdline;
-	LPACTION action;
-	UINT     icon;
-	BOOL     showConsole;
-
-	// calculated
-	BOOL     enabled;
-};
-
 class CModule : public CAtlDllModuleT<CModule>
 {
 public:
 };
 
 extern HINSTANCE _hInstance;
-extern CModule _AtlModule;
-
-class ATL_NO_VTABLE CMenu :
-	public CComObjectRootEx<CComSingleThreadModel>,
-	public CComCoClass<CMenu, &CLSID_CuteHgMenu>, 
-	public IShellExtInit, 
-	public IContextMenu3,
-	public ITest
-{
-public:
-	DECLARE_CLASSFACTORY();
-	DECLARE_NOT_AGGREGATABLE(CMenu);
-	DECLARE_REGISTRY_RESOURCEID(IDR_MENU);
-
-	BEGIN_COM_MAP(CMenu)
-	   COM_INTERFACE_ENTRY(IShellExtInit)
-	   COM_INTERFACE_ENTRY(IContextMenu)
-	   COM_INTERFACE_ENTRY(IContextMenu2)
-	   COM_INTERFACE_ENTRY(IContextMenu3)
-	   COM_INTERFACE_ENTRY(ITest)
-	END_COM_MAP()
-
-	// IShellExtInit
-	virtual HRESULT STDMETHODCALLTYPE Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
-
-	// IContextMenu
-    virtual HRESULT STDMETHODCALLTYPE QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
-    virtual HRESULT STDMETHODCALLTYPE InvokeCommand(CMINVOKECOMMANDINFO *pici);
-    virtual HRESULT STDMETHODCALLTYPE GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pReserved, LPSTR pszName, UINT cchMax);
-
-	// IContextMenu2
-	virtual HRESULT STDMETHODCALLTYPE HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
-
-	// IContextMenu3
-	virtual HRESULT STDMETHODCALLTYPE HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult);
-
-	// ITest
-	virtual HRESULT STDMETHODCALLTYPE Test(int a, LPCWSTR pwszMessage, int* pa, LPWSTR* pOut);
-
-private:
-	std::vector<string> m_Paths;
-	std::vector<MenuCommand> m_Commands;
-};
-
-template <class cls, const CLSID* rclsid, char status>
-class COverlayBase :
-	public CComObjectRootEx<CComSingleThreadModel>,
-	public CComCoClass<cls, rclsid>, 
-	public IShellIconOverlayIdentifier,
-	public ITest
-{
-public:
-	DECLARE_CLASSFACTORY();
-	DECLARE_NOT_AGGREGATABLE(cls);
-
-	static HRESULT STDMETHODCALLTYPE UpdateRegistry(BOOL bRegister);
-
-	BEGIN_COM_MAP(cls)
-	   COM_INTERFACE_ENTRY(IShellIconOverlayIdentifier)
-	   COM_INTERFACE_ENTRY(ITest)
-	END_COM_MAP()
-
-	// IShellIconOverlayIdentifier
-    virtual HRESULT STDMETHODCALLTYPE IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib);
-    virtual HRESULT STDMETHODCALLTYPE GetOverlayInfo(LPWSTR pwszIconFile, int cchMax, int *pIndex, DWORD *pdwFlags);
-	virtual HRESULT STDMETHODCALLTYPE GetPriority(int *pIPriority);
-
-	// ITest
-	virtual HRESULT STDMETHODCALLTYPE Test(int a, LPCWSTR pwszMessage, int* pa, LPWSTR* pOut);
-};
-
-#define DECLARE_OVERLAY(name, status)										\
-class C##name##Overlay:														\
-	public COverlayBase<C##name##Overlay, &CLSID_CuteHgIcon##name, status>	\
-{ public: static LPCWSTR GetName() { return L#name; } };					\
-OBJECT_ENTRY_AUTO(CLSID_CuteHgIcon##name, C##name##Overlay);
-
-DECLARE_OVERLAY(Added, 'A');
-DECLARE_OVERLAY(Ignored, 'I');
-DECLARE_OVERLAY(Normal, 'C');
-DECLARE_OVERLAY(Modified, 'M');
-DECLARE_OVERLAY(Unversioned, '?');
-OBJECT_ENTRY_AUTO(CLSID_CuteHgMenu, CMenu);
+extern CModule _AtlModule;

win32/shellext/dllmain.cpp

 HINSTANCE _hInstance;
 CModule _AtlModule;
 
+
 // DLL Entry Point
 extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
 {
 STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine)
 {
     HRESULT hr = E_FAIL;
-    static const wchar_t szUserSwitch[] = _T("user");
-
-    if (pszCmdLine != NULL)
-    {
-    	if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0)
-    	{
-    		AtlSetPerUserRegistration(true);
-    	}
-    }
 
     if (bInstall)
     {	

win32/shellext/fakeatl.cpp

+// CuteHg - Qt4 Dialog Extension of Mercurial
+// Copyright (C) 2009 Stefan Rusek 
+// 
+// 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/>.
+
+//-----------------------------------------------------------------------------
+//
+// This file exists because the VC Express versions do not contian ATL
+//
+//-----------------------------------------------------------------------------
+
+#include "common.h"
+
+ClassEntry::ClassEntry(const CLSID clsid, IClassFactory* (STDMETHODCALLTYPE *GetClassFactory)(), HRESULT (STDMETHODCALLTYPE *UpdateRegistry)(BOOL))
+{
+	this->next = _entries;
+	_entries = this;
+	this->clsid = clsid;
+	this->GetClassFactory = GetClassFactory;
+	this->UpdateRegistry = UpdateRegistry;
+}

win32/shellext/fakeatl.h

+// CuteHg - Qt4 Dialog Extension of Mercurial
+// Copyright (C) 2009 Stefan Rusek 
+// 
+// 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/>.
+
+//-----------------------------------------------------------------------------
+//
+// This file exists because the VC Express versions do not contian ATL
+//
+//-----------------------------------------------------------------------------
+
+#define ATL_NO_VTABLE __declspec(novtable)
+#define DECLARE_CLASSFACTORY()
+#define DECLARE_NOT_AGGREGATABLE(cls)
+
+#define DECLARE_LIBID(libid)
+#define DECLARE_REGISTRY_APPID_RESOURCEID(idr, szlibid)
+
+struct ClassEntry
+{
+	ClassEntry(const CLSID clsid, IClassFactory* (STDMETHODCALLTYPE *GetClassFactory)(), HRESULT (STDMETHODCALLTYPE *UpdateRegistry)(BOOL));
+	const ClassEntry* next;
+	CLSID clsid;
+	IClassFactory* (STDMETHODCALLTYPE *GetClassFactory)();
+	HRESULT (STDMETHODCALLTYPE *UpdateRegistry)(BOOL);
+};
+__declspec(selectany) const ClassEntry* _entries = NULL;
+#define OBJECT_ENTRY_AUTO(clsid, cls) \
+	__declspec(selectany) ClassEntry __COCLASS_##cls##_ENTRY(clsid, cls::GetClassFactory, cls::UpdateRegistry)
+
+struct _ATL_REGMAP_ENTRY
+{
+	LPCWSTR m_Key;
+	LPCWSTR m_Value;
+};
+
+template <class T>
+class CAtlDllModuleT
+{
+public:
+	BOOL DllMain(DWORD dwReason, LPVOID lpReserved)
+	{
+		return TRUE;
+	}
+
+	HRESULT DllCanUnloadNow()
+	{
+		return S_FALSE;
+	}
+
+	HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+	{
+		const ClassEntry* entry = _entries;
+		while (entry)
+		{
+			if (rclsid == entry->clsid)
+			{
+				*ppv = entry->GetClassFactory();
+				return S_OK;
+			}
+			entry = entry->next;
+		}
+		return E_INVALIDARG;
+	}
+
+	HRESULT DllRegisterServer(BOOL)
+	{
+		HRESULT hr = S_OK;
+		const ClassEntry* entry = _entries;
+		while (entry && SUCCEEDED(hr))
+		{
+			hr = entry->UpdateRegistry(TRUE);
+			entry = entry->next;
+		}
+		return hr;
+	}
+
+	HRESULT DllUnregisterServer()
+	{
+		HRESULT hr = S_OK;
+		const ClassEntry* entry = _entries;
+		while (entry && SUCCEEDED(hr))
+		{
+			hr = entry->UpdateRegistry(FALSE);
+			entry = entry->next;
+		}
+		return hr;
+	}
+
+	HRESULT UpdateRegistryFromResourceS(UINT idr, BOOL bRegister, _ATL_REGMAP_ENTRY* entries)
+	{
+		HMODULE hAtl = LoadLibrary(_T("ATL.DLL"));
+		if (!hAtl)
+			return HRESULT_FROM_WIN32(GetLastError());
+
+		FARPROC proc = GetProcAddress(hAtl, "AtlModuleUpdateRegistryFromResourceD");
+		if (!proc)
+			return HRESULT_FROM_WIN32(GetLastError());
+
+		typedef HRESULT (*LPUpdateRegistryFromResourceD)(HINSTANCE, UINT, BOOL, _ATL_REGMAP_ENTRY*);
+		LPUpdateRegistryFromResourceD UpdateRegistryFromResourceD = (LPUpdateRegistryFromResourceD)proc;
+
+		return UpdateRegistryFromResourceD(_hInstance, idr, bRegister, entries);
+	}
+};
+
+template <class coclass>
+class CCoClassFactory
+	: IClassFactory
+{
+public:
+	virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
+	{
+		if (riid == IID_IUnknown)
+		{
+			*ppvObject = (void*)(IUnknown*)this;
+			return S_OK;
+		}
+		if (riid == IID_IClassFactory)
+		{
+			*ppvObject = (void*)(IClassFactory*)this;
+			return S_OK;
+		}
+		return E_NOINTERFACE;
+	}
+
+	virtual ULONG STDMETHODCALLTYPE AddRef()
+	{
+		return 1;
+	}
+
+	virtual ULONG STDMETHODCALLTYPE Release()
+	{
+		return 1;
+	}
+
+	virtual HRESULT STDMETHODCALLTYPE CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject)
+	{
+		if (pUnkOuter != NULL)
+			return E_INVALIDARG;
+		CComObject<coclass>* punk = new CComObject<coclass>();
+		punk->AddRef();
+		
+		HRESULT hr = punk->QueryInterface(riid, ppvObject);
+		if (SUCCEEDED(hr))
+		{
+			hr = punk->Construct();
+			if (FAILED(hr))
+				punk->Release();
+		}
+
+		punk->Release();
+		return hr;
+	}
+
+	virtual HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock)
+	{
+		return S_OK;
+	}
+};
+
+class CComSingleThreadModel
+{
+public:
+	static ULONG Increment(ULONG& ul)
+	{
+		return ++ul;
+	}
+
+	static ULONG Decrement(ULONG& ul)
+	{
+		return --ul;
+	}
+};
+
+template <class base>
+class CComObject : public base
+{
+	BOOL m_constructed;
+
+protected:
+	virtual ~CComObject()
+	{
+		if (m_constructed)
+			FinalRelease();
+	}
+
+public:
+	CComObject() : m_constructed(FALSE)
+	{
+
+	}
+
+	virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
+	{
+		return InternalQueryInterface(riid, ppvObject);
+	}
+
+	virtual ULONG STDMETHODCALLTYPE AddRef()
+	{
+		return InternalAddRef();
+	}
+
+	virtual ULONG STDMETHODCALLTYPE Release()
+	{
+		ULONG result =  InternalRelease();
+		if (result == 0)
+		{
+			delete this;
+		}
+		return result;
+	}
+
+	HRESULT Construct()
+	{
+		m_constructed = TRUE;
+		return FinalConstruct();
+	}
+};
+
+template <class model>
+class ATL_NO_VTABLE CComObjectRootEx
+{
+	ULONG m_refcnt;
+protected:
+	virtual ULONG STDMETHODCALLTYPE InternalAddRef()
+	{
+		return model::Increment(m_refcnt);
+	}
+
+	virtual ULONG STDMETHODCALLTYPE InternalRelease()
+	{
+		return  model::Decrement(m_refcnt);
+	}
+
+	virtual HRESULT FinalConstruct()
+	{
+		return S_OK;
+	}
+
+	virtual void FinalRelease()
+	{
+	}
+};
+
+template <class cls, const CLSID* riid>
+class ATL_NO_VTABLE CComCoClass
+{
+public:
+	static IClassFactory* STDMETHODCALLTYPE GetClassFactory()
+	{
+		static CCoClassFactory<cls> Factory;
+		return (IClassFactory*)&Factory;
+	}
+};
+
+#define DECLARE_REGISTRY_RESOURCEID(idr) \
+	static HRESULT STDMETHODCALLTYPE UpdateRegistry(BOOL bRegister) \
+	{ return _AtlModule.UpdateRegistryFromResourceS(idr, bRegister, NULL); }
+
+#define BEGIN_COM_MAP(cls) HRESULT InternalQueryInterface(REFIID riid, void **ppvObject) {
+#define COM_INTERFACE_ENTRY(iface) if (riid == __uuidof(iface) || riid == IID_IUnknown) { *ppvObject = (void*)(iface*)this; return S_OK; }
+#define END_COM_MAP() return E_NOINTERFACE; };

win32/shellext/menu.cpp

 
 #include "common.h"
 #include <objidl.h>
-#include <atlimage.h>
+#include <gdiplus.h>
+
+struct MenuCommand;
+typedef HRESULT (CALLBACK *LPACTION)(const string&, const std::vector<string>*, const MenuCommand*);
+struct MenuCommand
+{
+	LPCSTR   showstatus;
+	LPCSTR   enablestatus;
+	LPCWSTR  verb;
+	LPCWSTR  text;
+	LPCWSTR  help;
+	LPCWSTR  cmdline;
+	LPACTION action;
+	UINT     icon;
+	BOOL     showConsole;
+
+	// calculated
+	BOOL     enabled;
+};
+
+class ATL_NO_VTABLE CMenu :
+	public CComObjectRootEx<CComSingleThreadModel>,
+	public CComCoClass<CMenu, &CLSID_CuteHgMenu>, 
+	public IShellExtInit, 
+	public IContextMenu3,
+	public ITest
+{
+public:
+	DECLARE_CLASSFACTORY();
+	DECLARE_NOT_AGGREGATABLE(CMenu);
+	DECLARE_REGISTRY_RESOURCEID(IDR_MENU);
+
+	BEGIN_COM_MAP(CMenu)
+	   COM_INTERFACE_ENTRY(IShellExtInit)
+	   COM_INTERFACE_ENTRY(IContextMenu)
+	   COM_INTERFACE_ENTRY(IContextMenu2)
+	   COM_INTERFACE_ENTRY(IContextMenu3)
+	   COM_INTERFACE_ENTRY(ITest)
+	END_COM_MAP()
+
+	// IShellExtInit
+	virtual HRESULT STDMETHODCALLTYPE Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
+
+	// IContextMenu
+    virtual HRESULT STDMETHODCALLTYPE QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
+    virtual HRESULT STDMETHODCALLTYPE InvokeCommand(CMINVOKECOMMANDINFO *pici);
+    virtual HRESULT STDMETHODCALLTYPE GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pReserved, LPSTR pszName, UINT cchMax);
+
+	// IContextMenu2
+	virtual HRESULT STDMETHODCALLTYPE HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	// IContextMenu3
+	virtual HRESULT STDMETHODCALLTYPE HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult);
+
+	// ITest
+	virtual HRESULT STDMETHODCALLTYPE Test(int a, LPCWSTR pwszMessage, int* pa, LPWSTR* pOut);
+
+private:
+	std::vector<string> m_Paths;
+	std::vector<MenuCommand> m_Commands;
+};
+OBJECT_ENTRY_AUTO(CLSID_CuteHgMenu, CMenu);
+
 
 HRESULT CALLBACK TestAction(const string&, const std::vector<string>*, const MenuCommand*);
 HRESULT CALLBACK StandardAction(const string&, const std::vector<string>*, const MenuCommand*);
 	{0},
 };
 
-BOOL ChgLoadBitmap(UINT resid, CImage* pbitmap)
+BOOL ChgLoadBitmap(UINT resid, Gdiplus::Bitmap** ppbitmap)
 {
 	HMODULE hmod = _hInstance;
 
 			IStream* pStream = NULL;
 			if (SUCCEEDED(CreateStreamOnHGlobal(hGlobTemp, FALSE, &pStream)))
 			{
-				rval = SUCCEEDED(pbitmap->Load(pStream));
+				*ppbitmap = Gdiplus::Bitmap::FromStream(pStream);
+				rval = (*ppbitmap && (*ppbitmap)->GetLastStatus() != Gdiplus::Ok);
 				pStream->Release();
 			}
 		}
 
 		if (pcmd->icon)
 		{
-			CImage img;
-			if (ChgLoadBitmap(pcmd->icon, &img))
+			Gdiplus::Bitmap* bmp;
+			if (ChgLoadBitmap(pcmd->icon, &bmp))
 			{
-				CImage icon;
-				icon.Create(16, 16, img.GetBPP());
-				HDC hdc = icon.GetDC();
+				Gdiplus::Bitmap bmpIcon(16, 16);
+				
+				{ // like a using block in C#
+					Gdiplus::Graphics g(&bmpIcon);
+					Gdiplus::SolidBrush brush(Gdiplus::Color::White);
+					g.FillRectangle(&brush, 0, 0, 16, 16);
+					g.DrawImage(bmp, 0, 0, 16, 16);
+				}
+				delete bmp;
 
-				RECT rect = { 0, 0, 16, 16};
-				FillRect(hdc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
-
-				img.AlphaBlend(hdc, 0, 0, 16, 16, 0, 0, img.GetWidth(), img.GetHeight());
-
-				icon.ReleaseDC();
-				mii.hbmpItem = icon.Detach();
+				if (Gdiplus::Ok != bmpIcon.GetHBITMAP(Gdiplus::Color::White, &mii.hbmpItem))
+					mii.hbmpItem = NULL;
+				mii.fMask = mii.fMask & ~MIIM_BITMAP;
 			}
 		}
 

win32/shellext/overlay.cpp

 #include "common.h"
 
 template <class cls, const CLSID* rclsid, char status>
+class ATL_NO_VTABLE COverlayBase :
+	public CComObjectRootEx<CComSingleThreadModel>,
+	public CComCoClass<cls, rclsid>, 
+	public IShellIconOverlayIdentifier,
+	public ITest
+{
+public:
+	DECLARE_CLASSFACTORY();
+	DECLARE_NOT_AGGREGATABLE(cls);
+
+	static HRESULT STDMETHODCALLTYPE UpdateRegistry(BOOL bRegister);
+
+	BEGIN_COM_MAP(cls)
+	   COM_INTERFACE_ENTRY(IShellIconOverlayIdentifier)
+	   COM_INTERFACE_ENTRY(ITest)
+	END_COM_MAP()
+
+	// IShellIconOverlayIdentifier
+    virtual HRESULT STDMETHODCALLTYPE IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib);
+    virtual HRESULT STDMETHODCALLTYPE GetOverlayInfo(LPWSTR pwszIconFile, int cchMax, int *pIndex, DWORD *pdwFlags);
+	virtual HRESULT STDMETHODCALLTYPE GetPriority(int *pIPriority);
+
+	// ITest
+	virtual HRESULT STDMETHODCALLTYPE Test(int a, LPCWSTR pwszMessage, int* pa, LPWSTR* pOut);
+};
+
+#define DECLARE_OVERLAY(name, status)										\
+class ATL_NO_VTABLE C##name##Overlay:										\
+	public COverlayBase<C##name##Overlay, &CLSID_CuteHgIcon##name, status>	\
+{ public: static LPCWSTR GetName() { return L#name; } };					\
+OBJECT_ENTRY_AUTO(CLSID_CuteHgIcon##name, C##name##Overlay);
+
+DECLARE_OVERLAY(Added, 'A');
+DECLARE_OVERLAY(Ignored, 'I');
+DECLARE_OVERLAY(Normal, 'C');
+DECLARE_OVERLAY(Modified, 'M');
+DECLARE_OVERLAY(Unversioned, '?');
+
+template <class cls, const CLSID* rclsid, char status>
 HRESULT COverlayBase<cls, rclsid, status>::UpdateRegistry(BOOL bRegister)
 {
 	LPOLESTR sclsid;

win32/shellext/shellext.vcproj

 			OutputDirectory="$(SolutionDir)..\..\build\"
 			IntermediateDirectory="$(OutDir)$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
-			UseOfATL="1"
+			UseOfATL="0"
 			CharacterSet="1"
 			EnableManagedIncrementalBuild="0"
 			>
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Ws2_32.lib"
+				AdditionalDependencies="Ws2_32.lib gdiplus.lib shlwapi.lib"
 				OutputFile="$(OutDir)\cutehg-shellext-$(PlatformName)-$(ConfigurationName).dll"
 				ModuleDefinitionFile="shellext.def"
 				GenerateDebugInformation="true"
 				GenerateMapFile="true"
+				MapFileName="$(TargetDir)$(TargetName).map"
 				TargetMachine="1"
 			/>
 			<Tool
 			OutputDirectory="$(SolutionDir)..\..\build\"
 			IntermediateDirectory="$(OutDir)$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
-			UseOfATL="1"
+			UseOfATL="0"
 			CharacterSet="1"
 			EnableManagedIncrementalBuild="0"
 			>
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Ws2_32.lib"
+				AdditionalDependencies="Ws2_32.lib gdiplus.lib shlwapi.lib"
 				OutputFile="$(OutDir)\cutehg-shellext-$(PlatformName)-$(ConfigurationName).dll"
 				ModuleDefinitionFile="shellext.def"
 				GenerateDebugInformation="true"
 				GenerateMapFile="true"
+				MapFileName="$(TargetDir)$(TargetName).map"
 				TargetMachine="17"
 			/>
 			<Tool
 			OutputDirectory="$(SolutionDir)..\..\build\"
 			IntermediateDirectory="$(OutDir)$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
-			UseOfATL="1"
+			UseOfATL="0"
 			CharacterSet="1"
 			WholeProgramOptimization="1"
 			EnableManagedIncrementalBuild="0"
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Ws2_32.lib"
+				AdditionalDependencies="Ws2_32.lib gdiplus.lib shlwapi.lib"
 				OutputFile="$(OutDir)\cutehg-shellext-$(PlatformName)-$(ConfigurationName).dll"
 				ModuleDefinitionFile="shellext.def"
 				GenerateDebugInformation="true"
 				GenerateMapFile="true"
+				MapFileName="$(TargetDir)$(TargetName).map"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
 				TargetMachine="1"
 			OutputDirectory="$(SolutionDir)..\..\build\"
 			IntermediateDirectory="$(OutDir)$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
-			UseOfATL="1"
+			UseOfATL="0"
 			CharacterSet="1"
 			WholeProgramOptimization="1"
 			EnableManagedIncrementalBuild="0"
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Ws2_32.lib"
+				AdditionalDependencies="Ws2_32.lib gdiplus.lib shlwapi.lib"
 				OutputFile="$(OutDir)\cutehg-shellext-$(PlatformName)-$(ConfigurationName).dll"
 				ModuleDefinitionFile="shellext.def"
 				GenerateDebugInformation="true"
 				GenerateMapFile="true"
+				MapFileName="$(TargetDir)$(TargetName).map"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
 				TargetMachine="17"
 				>
 			</File>
 			<File
+				RelativePath=".\fakeatl.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\menu.cpp"
 				>
 			</File>
 				>
 			</File>
 			<File
+				RelativePath=".\fakeatl.h"
+				>
+			</File>
+			<File
 				RelativePath=".\resource.h"
 				>
 			</File>