1 | //////////////////////////////////////////////////////////// |
---|
2 | // Copyright (C) Roman Ryltsov, 2008-2013 |
---|
3 | // Created by Roman Ryltsov roman@alax.info |
---|
4 | |
---|
5 | #pragma once |
---|
6 | |
---|
7 | //////////////////////////////////////////////////////////// |
---|
8 | // CUaMobileToolsModule |
---|
9 | |
---|
10 | class CUaMobileToolsModule : |
---|
11 | public CAtlDllModuleT<CUaMobileToolsModule> |
---|
12 | { |
---|
13 | public: |
---|
14 | |
---|
15 | DECLARE_LIBID(LIBID_AlaxInfoUaMobileTools) |
---|
16 | |
---|
17 | DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MODULE, "{4A08DB2F-10FA-483C-85D3-84F717833444}") |
---|
18 | |
---|
19 | public: |
---|
20 | // CUaMobileToolsModule |
---|
21 | CUaMobileToolsModule() throw() |
---|
22 | { |
---|
23 | AtlTraceSetDefaultSettings(); |
---|
24 | _W(CExceptionFilter::Initialize()); |
---|
25 | TraceModuleVersion(); |
---|
26 | //TraceModuleTerminationLockCount(); |
---|
27 | _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this); |
---|
28 | } |
---|
29 | ~CUaMobileToolsModule() throw() |
---|
30 | { |
---|
31 | _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this); |
---|
32 | CExceptionFilter::Terminate(); |
---|
33 | } |
---|
34 | |
---|
35 | // CAtlModule |
---|
36 | HRESULT AddCommonRGSReplacements(IRegistrarBase* pRegistrar) throw() |
---|
37 | { |
---|
38 | _A(pRegistrar); |
---|
39 | _ATLTRY |
---|
40 | { |
---|
41 | __C(__super::AddCommonRGSReplacements(pRegistrar)); |
---|
42 | _A(m_libid != GUID_NULL); |
---|
43 | __C(pRegistrar->AddReplacement(L"LIBID", _PersistHelper::StringFromIdentifier(m_libid))); |
---|
44 | TCHAR pszPath[MAX_PATH] = { 0 }; |
---|
45 | _W(GetModuleFileName(_AtlBaseModule.GetModuleInstance(), pszPath, DIM(pszPath))); |
---|
46 | __C(pRegistrar->AddReplacement(L"FILENAME", CStringW(PathFindFileName(pszPath)))); |
---|
47 | __C(pRegistrar->AddReplacement(L"DESCRIPTION", CStringW(AtlLoadString(IDS_PROJNAME)))); |
---|
48 | } |
---|
49 | _ATLCATCH(Exception) |
---|
50 | { |
---|
51 | _C(Exception); |
---|
52 | } |
---|
53 | return S_OK; |
---|
54 | } |
---|
55 | BOOL WINAPI DllMain(DWORD nReason, VOID* pvReserved) throw() |
---|
56 | { |
---|
57 | return __super::DllMain(nReason, pvReserved); |
---|
58 | } |
---|
59 | }; |
---|
60 | |
---|
61 | extern class CUaMobileToolsModule _AtlModule; |
---|