source: trunk/Utilities/WrapText/WrapText.cpp @ 937

Last change on this file since 937 was 43, checked in by roman, 12 years ago
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2011
3// Created by Roman Ryltsov roman@alax.info
4//
5// $Id: WrapText.cpp 43 2011-12-19 10:49:49Z roman $
6
7#include "stdafx.h"
8#include "resource.h"
9#include "WrapText_i.h"
10#include "MainDialog.h"
11
12////////////////////////////////////////////////////////////
13// CWrapTextModule
14
15class CWrapTextModule : 
16        public CAtlExeModuleT<CWrapTextModule>,
17        public CWtlExeModuleT<CWrapTextModule>
18{
19public:
20
21//DECLARE_LIBID(LIBID_AlaxInfoWrapText)
22
23//DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MODULE, "{0B0FCF8F-E12E-4E97-B683-06E3F93830E3}")
24
25public:
26// CWrapTextModule
27        CWrapTextModule() throw()
28        {
29#if defined(_DEBUG)
30                AtlTraceLoadSettings(NULL);
31#endif // defined(_DEBUG)
32                _W(CExceptionFilter::Initialize());
33                _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
34        }
35        ~CWrapTextModule() throw()
36        {
37                _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
38                CExceptionFilter::Terminate();
39        }
40        HRESULT PreMessageLoop(INT nShowCommand) throw()
41        {
42                _ATLTRY
43                {
44                        TraceModuleVersion();
45                        __E(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_COOL_CLASSES));
46                        //__C(CWtlExeModule::Initialize());
47                        __C(__super::PreMessageLoop(nShowCommand));
48                }
49                _ATLCATCH(Exception)
50                {
51                        _C(Exception);
52                }
53                return S_OK;
54        }
55        VOID RunMessageLoop() throw()
56        {
57                Lock();
58                {
59                        CMainDialog MainDialog;
60                        MainDialog.DoModal();
61                }
62                if(GetLockCount() == 1)
63                {
64                        m_dwTimeOut = 0L;
65                        m_dwPause = 0L;
66                }
67                Unlock();
68        }
69        HRESULT PostMessageLoop() throw()
70        {
71                _ATLTRY
72                {
73                        _V(__super::PostMessageLoop());
74                        //CWtlExeModule::Terminate();
75                }
76                _ATLCATCH(Exception)
77                {
78                        _C(Exception);
79                }
80                return S_OK;
81        }
82};
83
84CWrapTextModule _AtlModule;
85
86////////////////////////////////////////////////////////////
87// Main
88
89extern "C" int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, INT nShowCommand)
90{
91    return _AtlModule.WinMain(nShowCommand);
92}
93
Note: See TracBrowser for help on using the repository browser.