1 // TortoiseOverlays - an overlay handler for Tortoise clients
2 // Copyright (C) 2007, 2010 - TortoiseSVN
5 #include "ShellExtClassFactory.h"
7 CShellExtClassFactory::CShellExtClassFactory(FileState state
)
13 InterlockedIncrement(g_cRefThisDll
);
16 CShellExtClassFactory::~CShellExtClassFactory()
18 InterlockedDecrement(g_cRefThisDll
);
21 STDMETHODIMP
CShellExtClassFactory::QueryInterface(REFIID riid
,
29 // Any interface on this object is the object pointer
31 if (IsEqualIID(riid
, IID_IUnknown
) || IsEqualIID(riid
, IID_IClassFactory
))
33 *ppv
= (LPCLASSFACTORY
)this;
43 STDMETHODIMP_(ULONG
) CShellExtClassFactory::AddRef()
48 STDMETHODIMP_(ULONG
) CShellExtClassFactory::Release()
58 STDMETHODIMP
CShellExtClassFactory::CreateInstance(LPUNKNOWN pUnkOuter
,
67 // Shell extensions typically don't support aggregation (inheritance)
70 return CLASS_E_NOAGGREGATION
;
72 // Create the main shell extension object. The shell will then call
73 // QueryInterface with IID_IShellExtInit--this is how shell extensions are
76 CShellExt
* pShellExt
= new (std::nothrow
) CShellExt(m_StateToMake
); //Create the CShellExt object
78 if (NULL
== pShellExt
)
80 const HRESULT hr
= pShellExt
->QueryInterface(riid
, ppvObj
);
86 STDMETHODIMP
CShellExtClassFactory::LockServer(BOOL
/*fLock*/)