source: trunk/Utilities/VbsCallback/VbsCallback.cpp @ 937

Last change on this file since 937 was 88, checked in by roman, 12 years ago
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2012
3// Created by Roman Ryltsov roman@alax.info
4//
5// $Id: VbsCallback.cpp 88 2012-08-11 11:44:30Z roman $
6
7#include "stdafx.h"
8#include "resource.h"
9#include "VbsCallback_i.h"
10#include "dllmain.h"
11
12STDAPI DllCanUnloadNow(void)
13{
14        return _AtlModule.DllCanUnloadNow();
15}
16STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
17{
18        return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
19}
20STDAPI DllRegisterServer(void)
21{
22        HRESULT hr = _AtlModule.DllRegisterServer();
23        return hr;
24}
25STDAPI DllUnregisterServer(void)
26{
27        HRESULT hr = _AtlModule.DllUnregisterServer();
28        return hr;
29}
30STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine)
31{
32        HRESULT hr = E_FAIL;
33        static const wchar_t szUserSwitch[] = L"user";
34        if(pszCmdLine != NULL)
35                if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0)
36                        ATL::AtlSetPerUserRegistration(true);
37        if(bInstall)
38        {       
39                hr = DllRegisterServer();
40                if(FAILED(hr))
41                        DllUnregisterServer();
42        }
43        else
44                hr = DllUnregisterServer();
45        return hr;
46}
Note: See TracBrowser for help on using the repository browser.