source: trunk/DirectShowSpy/dllmain.h @ 188

Last change on this file since 188 was 147, checked in by roman, 10 years ago

COM registration UI

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2011
3// Created by Roman Ryltsov roman@alax.info
4//
5// $Id: dllmain.h 147 2012-11-22 22:49:34Z roman $
6
7#pragma once
8
9////////////////////////////////////////////////////////////
10// CDirectShowSpyModule
11
12class CDirectShowSpyModule : 
13        public CAtlDllModuleT<CDirectShowSpyModule>
14{
15public:
16
17DECLARE_LIBID(LIBID_AlaxInfoDirectShowSpy)
18
19DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MODULE, "{DC64B11B-10DC-4F58-9485-17655B8A393E}")
20
21public:
22// CDirectShowSpyModule
23        CDirectShowSpyModule() throw()
24        {
25                AtlTraceSetDefaultSettings();
26                TraceModuleVersion();
27                _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
28                _W(CExceptionFilter::Initialize());
29        }
30        ~CDirectShowSpyModule() throw()
31        {
32                _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
33                CExceptionFilter::Terminate();
34        }
35
36// CAtlModule
37        HRESULT AddCommonRGSReplacements(IRegistrarBase* pRegistrar) throw()
38        {
39                _A(pRegistrar);
40                _ATLTRY
41                {
42                        __C(__super::AddCommonRGSReplacements(pRegistrar));
43                        _A(!IsEqualGUID(m_libid, GUID_NULL));
44                        __C(pRegistrar->AddReplacement(L"LIBID", _PersistHelper::StringFromIdentifier(m_libid)));
45                        TCHAR pszPath[MAX_PATH] = { 0 };
46                        _W(GetModuleFileName(_AtlBaseModule.GetModuleInstance(), pszPath, DIM(pszPath)));
47                        __C(pRegistrar->AddReplacement(L"FILENAME", CStringW(PathFindFileName(pszPath))));
48                        __C(pRegistrar->AddReplacement(L"DESCRIPTION", CStringW(AtlLoadString(IDS_PROJNAME))));
49                }
50                _ATLCATCH(Exception)
51                {
52                        _C(Exception);
53                }
54                return S_OK;
55        }
56        BOOL WINAPI DllMain(DWORD nReason, VOID* pvReserved) throw()
57        {
58                return __super::DllMain(nReason, pvReserved);
59        }
60};
61
62extern class CDirectShowSpyModule _AtlModule;
63
Note: See TracBrowser for help on using the repository browser.