-
Notifications
You must be signed in to change notification settings - Fork 0
/
mscomm1.h
455 lines (440 loc) · 11.3 KB
/
mscomm1.h
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
#pragma once
// 计算机生成了由 Microsoft Visual C++ 创建的 IDispatch 包装器类
// 注意: 不要修改此文件的内容。 如果此类由
// Microsoft Visual C++ 重新生成,您的修改将被覆盖。
/////////////////////////////////////////////////////////////////////////////
// CMscomm1 包装器类
class CMscomm1 : public CWnd
{
protected:
DECLARE_DYNCREATE(CMscomm1)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0x648A5600, 0x2C6E, 0x101B, { 0x82, 0xB6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID);
}
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey);
}
// 特性
public:
enum
{
NoHandshaking = 0,
XonXoff = 1,
RtsCts = 2,
XonXoffAndRtsCts = 3
}HandshakingConstants;
enum
{
comNone = 0,
comXOnXoff = 1,
comRTS = 2,
comRTSXOnXOff = 3
}HandshakeConstants;
enum
{
comInvalidPropertyValue = 380,
comGetNotSupported = 394,
comSetNotSupported = 383,
comPortInvalid = 8002,
comPortAlreadyOpen = 8005,
comPortOpen = 8000,
comNoOpen = 8012,
comSetCommStateFailed = 8015,
comPortNotOpen = 8018,
comReadError = 8020,
comDCBError = 8021,
comBreak = 1001,
comCTSTO = 1002,
comDSRTO = 1003,
comFrame = 1004,
comOverrun = 1006,
comCDTO = 1007,
comRxOver = 1008,
comRxParity = 1009,
comTxFull = 1010,
comDCB = 1011
}ErrorConstants;
enum
{
comEventBreak = 1001,
comEventCTSTO = 1002,
comEventDSRTO = 1003,
comEventFrame = 1004,
comEventOverrun = 1006,
comEventCDTO = 1007,
comEventRxOver = 1008,
comEventRxParity = 1009,
comEventTxFull = 1010,
comEventDCB = 1011
}CommEventConstants;
enum
{
comEvSend = 1,
comEvReceive = 2,
comEvCTS = 3,
comEvDSR = 4,
comEvCD = 5,
comEvRing = 6,
comEvEOF = 7
}OnCommConstants;
enum
{
comInputModeText = 0,
comInputModeBinary = 1
}InputModeConstants;
// 操作
public:
// IMSComm
// Functions
//
void put_CDHolding(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0x1, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_CDHolding()
{
BOOL result;
InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_CDTimeout(long newValue)
{
static BYTE parms[] = VTS_I4 ;
InvokeHelper(0x2, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
long get_CDTimeout()
{
long result;
InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void put_CommID(long newValue)
{
static BYTE parms[] = VTS_I4 ;
InvokeHelper(0x3, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
long get_CommID()
{
long result;
InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void put_CommPort(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0x4, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_CommPort()
{
short result;
InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put__CommPort(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0x0, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get__CommPort()
{
short result;
InvokeHelper(0x0, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_CTSHolding(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0x5, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_CTSHolding()
{
BOOL result;
InvokeHelper(0x5, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_CTSTimeout(long newValue)
{
static BYTE parms[] = VTS_I4 ;
InvokeHelper(0x6, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
long get_CTSTimeout()
{
long result;
InvokeHelper(0x6, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void put_DSRHolding(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0x7, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_DSRHolding()
{
BOOL result;
InvokeHelper(0x7, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_DSRTimeout(long newValue)
{
static BYTE parms[] = VTS_I4 ;
InvokeHelper(0x8, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
long get_DSRTimeout()
{
long result;
InvokeHelper(0x8, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void put_DTREnable(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0x9, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_DTREnable()
{
BOOL result;
InvokeHelper(0x9, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_Handshaking(long newValue)
{
static BYTE parms[] = VTS_I4 ;
InvokeHelper(0xa, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
long get_Handshaking()
{
long result;
InvokeHelper(0xa, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void put_InBufferSize(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0xb, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_InBufferSize()
{
short result;
InvokeHelper(0xb, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_InBufferCount(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0xc, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_InBufferCount()
{
short result;
InvokeHelper(0xc, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_Break(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0xd, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_Break()
{
BOOL result;
InvokeHelper(0xd, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_InputLen(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0xe, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_InputLen()
{
short result;
InvokeHelper(0xe, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_Interval(long newValue)
{
static BYTE parms[] = VTS_I4 ;
InvokeHelper(0xf, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
long get_Interval()
{
long result;
InvokeHelper(0xf, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void put_NullDiscard(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0x10, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_NullDiscard()
{
BOOL result;
InvokeHelper(0x10, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_OutBufferSize(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0x11, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_OutBufferSize()
{
short result;
InvokeHelper(0x11, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_OutBufferCount(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0x12, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_OutBufferCount()
{
short result;
InvokeHelper(0x12, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_ParityReplace(LPCTSTR newValue)
{
static BYTE parms[] = VTS_BSTR ;
InvokeHelper(0x13, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
CString get_ParityReplace()
{
CString result;
InvokeHelper(0x13, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
void put_PortOpen(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0x14, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_PortOpen()
{
BOOL result;
InvokeHelper(0x14, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_RThreshold(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0x15, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_RThreshold()
{
short result;
InvokeHelper(0x15, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_RTSEnable(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0x16, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_RTSEnable()
{
BOOL result;
InvokeHelper(0x16, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_Settings(LPCTSTR newValue)
{
static BYTE parms[] = VTS_BSTR ;
InvokeHelper(0x17, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
CString get_Settings()
{
CString result;
InvokeHelper(0x17, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}
void put_SThreshold(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0x18, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_SThreshold()
{
short result;
InvokeHelper(0x18, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_Output(VARIANT newValue)
{
static BYTE parms[] = VTS_VARIANT ;
InvokeHelper(0x19, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, &newValue);
}
VARIANT get_Output()
{
VARIANT result;
InvokeHelper(0x19, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&result, NULL);
return result;
}
void put_Input(VARIANT newValue)
{
static BYTE parms[] = VTS_VARIANT ;
InvokeHelper(0x1a, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, &newValue);
}
VARIANT get_Input()
{
VARIANT result;
InvokeHelper(0x1a, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&result, NULL);
return result;
}
void put_CommEvent(short newValue)
{
static BYTE parms[] = VTS_I2 ;
InvokeHelper(0x1b, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
short get_CommEvent()
{
short result;
InvokeHelper(0x1b, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void put_EOFEnable(BOOL newValue)
{
static BYTE parms[] = VTS_BOOL ;
InvokeHelper(0x1c, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
BOOL get_EOFEnable()
{
BOOL result;
InvokeHelper(0x1c, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void put_InputMode(long newValue)
{
static BYTE parms[] = VTS_I4 ;
InvokeHelper(0x1d, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
}
long get_InputMode()
{
long result;
InvokeHelper(0x1d, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
void AboutBox()
{
InvokeHelper(DISPID_ABOUTBOX, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
// Properties
//
};