AJA NTV2 SDK  17.6.0.2675
NTV2 SDK 17.6.0.2675
cprop.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // File: CProp.h
3 //
4 // Desc: DirectShow base classes.
5 //
6 // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
8 
9 
10 #ifndef __CPROP__
11 #define __CPROP__
12 
13 // Base property page class. Filters typically expose custom properties by
14 // implementing special control interfaces, examples are IDirectDrawVideo
15 // and IQualProp on renderers. This allows property pages to be built that
16 // use the given interface. Applications such as the ActiveMovie OCX query
17 // filters for the property pages they support and expose them to the user
18 //
19 // This class provides all the framework for a property page. A property
20 // page is a COM object that supports IPropertyPage. We should be created
21 // with a resource ID for the dialog which we will load when required. We
22 // should also be given in the constructor a resource ID for a title string
23 // we will load from the DLLs STRINGTABLE. The property page titles must be
24 // stored in resource files so that they can be easily internationalised
25 //
26 // We have a number of virtual methods (not PURE) that may be overriden in
27 // derived classes to query for interfaces and so on. These functions have
28 // simple implementations here that just return NOERROR. Derived classes
29 // will almost definately have to override the message handler method called
30 // OnReceiveMessage. We have a static dialog procedure that calls the method
31 // so that derived classes don't have to fiddle around with the this pointer
32 
33 class AM_NOVTABLE CBasePropertyPage : public IPropertyPage, public CUnknown
34 {
35 protected:
36 
37  LPPROPERTYPAGESITE m_pPageSite; // Details for our property site
38  HWND m_hwnd; // Window handle for the page
39  HWND m_Dlg; // Actual dialog window handle
40  BOOL m_bDirty; // Has anything been changed
41  int m_TitleId; // Resource identifier for title
42  int m_DialogId; // Dialog resource identifier
43 
44  static INT_PTR CALLBACK DialogProc(HWND hwnd,
45  UINT uMsg,
46  WPARAM wParam,
47  LPARAM lParam);
48 
49 private:
50  BOOL m_bObjectSet ; // SetObject has been called or not.
51 public:
52 
53  CBasePropertyPage(__in_opt LPCTSTR pName, // Debug only name
54  __inout_opt LPUNKNOWN pUnk, // COM Delegator
55  int DialogId, // Resource ID
56  int TitleId); // To get tital
57 
58 #ifdef UNICODE
59  CBasePropertyPage(__in_opt LPCSTR pName,
60  __inout_opt LPUNKNOWN pUnk,
61  int DialogId,
62  int TitleId);
63 #endif
64  virtual ~CBasePropertyPage() { };
66 
67  // Override these virtual methods
68 
69  virtual HRESULT OnConnect(IUnknown *pUnknown) { return NOERROR; };
70  virtual HRESULT OnDisconnect() { return NOERROR; };
71  virtual HRESULT OnActivate() { return NOERROR; };
72  virtual HRESULT OnDeactivate() { return NOERROR; };
73  virtual HRESULT OnApplyChanges() { return NOERROR; };
74  virtual INT_PTR OnReceiveMessage(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
75 
76  // These implement an IPropertyPage interface
77 
78  STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
79  STDMETHODIMP_(ULONG) NonDelegatingRelease();
80  STDMETHODIMP_(ULONG) NonDelegatingAddRef();
81  STDMETHODIMP SetPageSite(__in_opt LPPROPERTYPAGESITE pPageSite);
82  STDMETHODIMP Activate(HWND hwndParent, LPCRECT prect,BOOL fModal);
83  STDMETHODIMP Deactivate(void);
84  STDMETHODIMP GetPageInfo(__out LPPROPPAGEINFO pPageInfo);
85  STDMETHODIMP SetObjects(ULONG cObjects, __in_ecount_opt(cObjects) LPUNKNOWN *ppUnk);
86  STDMETHODIMP Show(UINT nCmdShow);
87  STDMETHODIMP Move(LPCRECT prect);
88  STDMETHODIMP IsPageDirty(void) { return m_bDirty ? S_OK : S_FALSE; }
89  STDMETHODIMP Apply(void);
90  STDMETHODIMP Help(LPCWSTR lpszHelpDir) { return E_NOTIMPL; }
91  STDMETHODIMP TranslateAccelerator(__inout LPMSG lpMsg) { return E_NOTIMPL; }
92 };
93 
94 #endif // __CPROP__
95 
DECLARE_IUNKNOWN
#define DECLARE_IUNKNOWN
Definition: combase.h:285
CUnknown::STDMETHODIMP_
STDMETHODIMP_(ULONG) NonDelegatingAddRef()
CBasePropertyPage::m_Dlg
HWND m_Dlg
Definition: cprop.h:39
CBasePropertyPage::m_pPageSite
LPPROPERTYPAGESITE m_pPageSite
Definition: cprop.h:37
CUnknown::NonDelegatingQueryInterface
STDMETHODIMP NonDelegatingQueryInterface(REFIID, __deref_out void **)
Definition: combase.cpp:135
CBasePropertyPage::OnDeactivate
virtual HRESULT OnDeactivate()
Definition: cprop.h:72
CBasePropertyPage::~CBasePropertyPage
virtual ~CBasePropertyPage()
Definition: cprop.h:64
pName
CHAR * pName
Definition: amvideo.cpp:26
CBasePropertyPage::TranslateAccelerator
STDMETHODIMP TranslateAccelerator(__inout LPMSG lpMsg)
Definition: cprop.h:91
CBasePropertyPage::IsPageDirty
STDMETHODIMP IsPageDirty(void)
Definition: cprop.h:88
riid
__in REFIID riid
Definition: dllentry.cpp:192
CBasePropertyPage::m_TitleId
int m_TitleId
Definition: cprop.h:41
CBasePropertyPage::OnApplyChanges
virtual HRESULT OnApplyChanges()
Definition: cprop.h:73
CUnknown
Definition: combase.h:200
CBasePropertyPage::Help
STDMETHODIMP Help(LPCWSTR lpszHelpDir)
Definition: cprop.h:90
CBasePropertyPage::OnConnect
virtual DECLARE_IUNKNOWN HRESULT OnConnect(IUnknown *pUnknown)
Definition: cprop.h:69
ULONG
ULONG(__stdcall *_RegisterTraceGuids)(__in IN WMIDPREQUEST RequestAddress
CBasePropertyPage::OnActivate
virtual HRESULT OnActivate()
Definition: cprop.h:71
CBasePropertyPage::m_DialogId
int m_DialogId
Definition: cprop.h:42
CBasePropertyPage
Definition: cprop.h:33
CBasePropertyPage::m_bDirty
BOOL m_bDirty
Definition: cprop.h:40
CBasePropertyPage::OnDisconnect
virtual HRESULT OnDisconnect()
Definition: cprop.h:70
CBasePropertyPage::m_hwnd
HWND m_hwnd
Definition: cprop.h:38