source: trunk/DirectShowSpy/dllmain.h @ 143

Last change on this file since 143 was 95, checked in by roman, 12 years ago

DirectShowSpy? moved from Assembla

  • 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 95 2012-08-17 17:21:13Z 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#if defined(_DEBUG)
26                AtlTraceLoadSettings(NULL);
27#endif // defined(_DEBUG)
28                _W(CExceptionFilter::Initialize());
29                TraceModuleVersion();
30                _Z4(atlTraceRefcount, 4, _T("this 0x%08x\n"), this);
31        }
32        ~CDirectShowSpyModule() throw()
33        {
34                _Z4(atlTraceRefcount, 4, _T("this 0x%08x\n"), this);
35                CExceptionFilter::Terminate();
36        }
37
38// CAtlModule
39        HRESULT AddCommonRGSReplacements(IRegistrarBase* pRegistrar) throw()
40        {
41                _A(pRegistrar);
42                _ATLTRY
43                {
44                        __C(__super::AddCommonRGSReplacements(pRegistrar));
45                        _A(!IsEqualGUID(m_libid, GUID_NULL));
46                        __C(pRegistrar->AddReplacement(L"LIBID", _PersistHelper::StringFromIdentifier(m_libid)));
47                        TCHAR pszPath[MAX_PATH] = { 0 };
48                        _W(GetModuleFileName(_AtlBaseModule.GetModuleInstance(), pszPath, DIM(pszPath)));
49                        __C(pRegistrar->AddReplacement(L"FILENAME", CStringW(PathFindFileName(pszPath))));
50                        __C(pRegistrar->AddReplacement(L"DESCRIPTION", CStringW(AtlLoadString(IDS_PROJNAME))));
51                }
52                _ATLCATCH(Exception)
53                {
54                        _C(Exception);
55                }
56                return S_OK;
57        }
58        BOOL WINAPI DllMain(DWORD nReason, VOID* pvReserved) throw()
59        {
60                return __super::DllMain(nReason, pvReserved);
61        }
62};
63
64extern class CDirectShowSpyModule _AtlModule;
65
Note: See TracBrowser for help on using the repository browser.