-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathD2DPrintJobChecker.h
More file actions
98 lines (86 loc) · 2.73 KB
/
D2DPrintJobChecker.h
File metadata and controls
98 lines (86 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//// PARTICULAR PURPOSE.
////
//// Copyright (c) Microsoft Corporation. All rights reserved
#pragma once
#ifndef _DIRECT2D_PRINT_JOB_CHECKER_
#define _DIRECT2D_PRINT_JOB_CHECKER_
#ifndef UNICODE
#define UNICODE
#endif
// DirectX header files.
#include <d2d1_1.h>
#include <xpsobjectmodel_1.h>
#include <DocumentTarget.h>
class D2DPrintJobChecker : public IPrintDocumentPackageStatusEvent
{
public:
D2DPrintJobChecker();
~D2DPrintJobChecker();
// Implement virtual functions from interface IUnknown.
virtual
HRESULT STDMETHODCALLTYPE
QueryInterface(
REFIID iid,
_Out_ void** ppvObject
);
virtual ULONG STDMETHODCALLTYPE AddRef();
virtual ULONG STDMETHODCALLTYPE Release();
// Implement virtual functions from interface IDispatch.
virtual STDMETHODIMP
GetTypeInfoCount(
_Out_ UINT* pctinfo
);
virtual STDMETHODIMP
GetTypeInfo(
UINT iTInfo,
LCID lcid,
_Outptr_result_maybenull_ ITypeInfo** ppTInfo
);
virtual STDMETHODIMP
GetIDsOfNames(
_In_ REFIID riid,
_In_reads_(cNames) LPOLESTR* rgszNames,
_In_range_(0, 16384) UINT cNames,
LCID lcid,
__out_ecount_full(cNames) DISPID* rgDispId
);
virtual STDMETHODIMP
Invoke(
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS* pDispParams,
VARIANT* pVarResult,
EXCEPINFO* pExcepInfo,
UINT* puArgErr
);
// Implement virtual functions from interface IPrintDocumentPackageStatusEvent.
virtual STDMETHODIMP
PackageStatusUpdated(
_In_ PrintDocumentPackageStatus* packageStatus
);
// New functions in D2DPrintJobChecker.
HRESULT Initialize(
_In_ IPrintDocumentPackageTarget* documentPackageTarget
);
PrintDocumentPackageStatus GetStatus();
HRESULT WaitForCompletion();
static void OutputPackageStatus(
_In_ PrintDocumentPackageStatus packageStatus
);
private:
void ReleaseResources();
private:
PrintDocumentPackageStatus m_documentPackageStatus;
DWORD m_eventCookie;
ULONG m_refcount;
HANDLE m_completionEvent;
CRITICAL_SECTION m_criticalSection;
IConnectionPoint* m_connectionPoint;
bool m_isInitialized;
};
#endif // _DIRECT2D_PRINT_JOB_CHECKER_