source: trunk/Utilities/LogicalProcessorInformation/Application.cpp @ 795

Last change on this file since 795 was 795, checked in by roman, 6 years ago
File size: 2.0 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2006-2017
3// Created by Roman Ryltsov roman@alax.info
4//
5// A permission to use the source code is granted as long as reference to
6// source website http://alax.info is retained.
7
8#include "stdafx.h"
9#include "resource.h"
10//#include "Module_i.h"
11#include "MainDialog.h"
12
13////////////////////////////////////////////////////////////
14// CLogicalProcessorInformationModule
15
16class CLogicalProcessorInformationModule : 
17        public CAtlExeModuleT<CLogicalProcessorInformationModule>,
18        public CWtlExeModuleT<CLogicalProcessorInformationModule>
19{
20public:
21
22//DECLARE_LIBID(LIBID_AlaxInfoLogicalProcessorInformationModule)
23
24//DECLARE_REGISTRY_APPID_RESOURCEID(IDI_MODULE, "{...}")
25
26public:
27// CLogicalProcessorInformationModule
28        CLogicalProcessorInformationModule()
29        {
30                AtlTraceSetDefaultSettings();
31                _Z4_THIS();
32                _W(CExceptionFilter::Initialize());
33        }
34        ~CLogicalProcessorInformationModule()
35        {
36                _Z4_THIS();
37                CExceptionFilter::Terminate();
38        }
39        HRESULT PreMessageLoop(INT nShowCommand)
40        {
41                _ATLTRY
42                {
43                        TraceModuleVersion();
44                        __E(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_COOL_CLASSES));
45                        //__C(CWtlExeModule::Initialize());
46                        __C(__super::PreMessageLoop(nShowCommand));
47                }
48                _ATLCATCH(Exception)
49                {
50                        _C(Exception);
51                }
52                return S_OK;
53        }
54        VOID RunMessageLoop()
55        {
56                Lock();
57                {
58                        CMainDialog MainDialog;
59                        MainDialog.DoModal();
60                }
61                if(GetLockCount() == 1)
62                {
63                        m_dwTimeOut = 0L;
64                        m_dwPause = 0L;
65                }
66                Unlock();
67        }
68        HRESULT PostMessageLoop()
69        {
70                _ATLTRY
71                {
72                        _V(__super::PostMessageLoop());
73                        //CWtlExeModule::Terminate();
74                }
75                _ATLCATCH(Exception)
76                {
77                        _C(Exception);
78                }
79                return S_OK;
80        }
81};
82
83CLogicalProcessorInformationModule _AtlModule;
84
85////////////////////////////////////////////////////////////
86// Main
87
88extern "C" int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, INT nShowCommand)
89{
90    return _AtlModule.WinMain(nShowCommand);
91}
92
Note: See TracBrowser for help on using the repository browser.