1 | //////////////////////////////////////////////////////////// |
---|
2 | // Copyright (C) Roman Ryltsov, 2008-2012 |
---|
3 | // Created by Roman Ryltsov roman@alax.info |
---|
4 | // |
---|
5 | // $Id: RenderInterlacedVideo.cpp 74 2012-07-15 11:10:51Z roman $ |
---|
6 | |
---|
7 | #include "stdafx.h" |
---|
8 | #include "resource.h" |
---|
9 | #include "RenderInterlacedVideo_i.h" |
---|
10 | #include "MainPropertySheet.h" |
---|
11 | |
---|
12 | //////////////////////////////////////////////////////////// |
---|
13 | // CRenderInterlacedVideoModule |
---|
14 | |
---|
15 | class CRenderInterlacedVideoModule : |
---|
16 | public CAtlExeModuleT<CRenderInterlacedVideoModule>, |
---|
17 | public CWtlExeModuleT<CRenderInterlacedVideoModule> |
---|
18 | { |
---|
19 | public: |
---|
20 | |
---|
21 | //DECLARE_LIBID(LIBID_AlaxInfoRenderInterlacedVideo) |
---|
22 | |
---|
23 | //DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MODULE, "{07B79191-7939-462E-8F28-4F02BC0AF1D4}") |
---|
24 | |
---|
25 | public: |
---|
26 | // CRenderInterlacedVideoModule |
---|
27 | CRenderInterlacedVideoModule() 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 | ~CRenderInterlacedVideoModule() 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 | CMainPropertySheet MainPropertySheet; |
---|
60 | MainPropertySheet.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 | |
---|
84 | CRenderInterlacedVideoModule _AtlModule; |
---|
85 | |
---|
86 | //////////////////////////////////////////////////////////// |
---|
87 | // Main |
---|
88 | |
---|
89 | extern "C" int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, INT nShowCommand) |
---|
90 | { |
---|
91 | return _AtlModule.WinMain(nShowCommand); |
---|
92 | } |
---|
93 | |
---|