source: trunk/Utilities/UaMobileTools/dllmain.h @ 106

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