Update Scintilla to version 3.5.7
[TortoiseGit.git] / contrib / issue-tracker-plugins / ExampleAtlPlugin / ExampleAtlPlugin.cpp
blob0bd3bb8985f25ea703780c2edba374afea5504e5
1 // ExampleAtlPlugin.cpp : Implementation of DLL Exports.
4 #include "stdafx.h"
5 #include "resource.h"
6 #include "ExampleAtlPlugin_i.h"
7 #include "dllmain.h"
9 // Used to determine whether the DLL can be unloaded by OLE
10 STDAPI DllCanUnloadNow(void)
12 return _AtlModule.DllCanUnloadNow();
16 // Returns a class factory to create an object of the requested type
17 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
19 return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
23 // DllRegisterServer - Adds entries to the system registry
24 STDAPI DllRegisterServer(void)
26 // registers object, typelib and all interfaces in typelib
27 HRESULT hr = _AtlModule.DllRegisterServer();
28 return hr;
32 // DllUnregisterServer - Removes entries from the system registry
33 STDAPI DllUnregisterServer(void)
35 HRESULT hr = _AtlModule.DllUnregisterServer();
36 return hr;
39 // DllInstall - Adds/Removes entries to the system registry per user
40 // per machine.
41 STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine)
43 HRESULT hr = E_FAIL;
44 static const wchar_t szUserSwitch[] = _T("user");
46 if (pszCmdLine != NULL)
48 if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0)
50 AtlSetPerUserRegistration(true);
54 if (bInstall)
56 hr = DllRegisterServer();
57 if (FAILED(hr))
59 DllUnregisterServer();
62 else
64 hr = DllUnregisterServer();
67 return hr;