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

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