source: trunk/DirectShowSpy/dllmain.h @ 196

Last change on this file since 196 was 196, checked in by roman, 9 years ago

Cosmetic fixes, new .BAT names, UnregisterTreatAsClasses? export to force removal of TreatAs? keys

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