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 | |
---|
12 | class CDirectShowSpyModule : |
---|
13 | public CAtlDllModuleT<CDirectShowSpyModule> |
---|
14 | { |
---|
15 | public: |
---|
16 | |
---|
17 | DECLARE_LIBID(LIBID_AlaxInfoDirectShowSpy) |
---|
18 | |
---|
19 | DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MODULE, "{DC64B11B-10DC-4F58-9485-17655B8A393E}") |
---|
20 | |
---|
21 | public: |
---|
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 | |
---|
64 | extern class CDirectShowSpyModule _AtlModule; |
---|
65 | |
---|