1 // ExampleAtlPlugin.cpp : Implementation of DLL Exports.
6 #include "ExampleAtlPlugin_i.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();
32 // DllUnregisterServer - Removes entries from the system registry
33 STDAPI
DllUnregisterServer(void)
35 HRESULT hr
= _AtlModule
.DllUnregisterServer();
39 // DllInstall - Adds/Removes entries to the system registry per user
41 STDAPI
DllInstall(BOOL bInstall
, LPCWSTR pszCmdLine
)
44 static const wchar_t szUserSwitch
[] = _T("user");
46 if (pszCmdLine
!= NULL
)
48 if (_wcsnicmp(pszCmdLine
, szUserSwitch
, _countof(szUserSwitch
)) == 0)
50 AtlSetPerUserRegistration(true);
56 hr
= DllRegisterServer();
59 DllUnregisterServer();
64 hr
= DllUnregisterServer();