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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
//+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1993.
//
// File: tests.c
//
// Contents: unit tests for 32bit OLE
//
// Classes:
//
// Functions: StartClipboardTest1
//
// History: dd-mmm-yy Author Comment
// 16-Jun-94 alexgo author
//
//--------------------------------------------------------------------------
#include "outline.h"
//+-------------------------------------------------------------------------
//
// Function: StartClipboardTest1
//
// Synopsis: copies the loaded object to the clipboard
//
// Effects:
//
// Arguments: void
//
// Requires:
//
// Returns: void
//
// Signals:
//
// Modifies:
//
// Algorithm:
//
// History: dd-mmm-yy Author Comment
// 16-Jun-94 alexgo author
//
// Notes:
//
//--------------------------------------------------------------------------
void StartClipboardTest1( LPOUTLINEAPP lpOutlineApp)
{
static char FileName[] = "letest12.olc";
BOOL fStatus;
HRESULT hresult = ResultFromScode(E_FAIL);
lpOutlineApp->m_lpDoc = OutlineApp_CreateDoc(lpOutlineApp, FALSE);
if (! lpOutlineApp->m_lpDoc)
{
goto errRtn;
}
fStatus = OutlineDoc_LoadFromFile(lpOutlineApp->m_lpDoc,
FileName);
if( !fStatus )
{
hresult = ResultFromScode(STG_E_FILENOTFOUND);
goto errRtn;
}
// position and size the new doc window
OutlineApp_ResizeWindows(lpOutlineApp);
OutlineDoc_ShowWindow(lpOutlineApp->m_lpDoc);
// we post a message here to give outline a chance to setup its
// UI before we do the copy.
UpdateWindow(lpOutlineApp->m_hWndApp);
OutlineDoc_SelectAllCommand(lpOutlineApp->m_lpDoc);
PostMessage(lpOutlineApp->m_hWndApp, WM_TEST2, 0, 0);
return;
errRtn:
// we should abort if error
PostMessage(g_hwndDriver, WM_TESTEND, TEST_FAILURE, hresult);
PostMessage(lpOutlineApp->m_hWndApp, WM_SYSCOMMAND, SC_CLOSE, 0L);
}
//+-------------------------------------------------------------------------
//
// Function: ContinueClipboardTest1
//
// Synopsis: finishes up the clipboard test
//
// Effects:
//
// Arguments:
//
// Requires:
//
// Returns:
//
// Signals:
//
// Modifies:
//
// Algorithm:
//
// History: dd-mmm-yy Author Comment
// 16-Jun-94 alexgo author
// Notes:
//
//--------------------------------------------------------------------------
void ContinueClipboardTest1( LPOUTLINEAPP lpOutlineApp )
{
OutlineDoc_CopyCommand(lpOutlineApp->m_lpDoc);
OleApp_FlushClipboard((LPOLEAPP)lpOutlineApp);
//flushing will make the app dirty, just reset that here ;-)
lpOutlineApp->m_lpDoc->m_fModified = FALSE;
PostMessage(g_hwndDriver, WM_TEST1, NOERROR, 0);
PostMessage(lpOutlineApp->m_hWndApp, WM_SYSCOMMAND, SC_CLOSE, 0L);
}
|