Вы находитесь на странице: 1из 305

2006

32.973.267
004.42(075)

. .
67

. .:
, 2006. 304 .: .

ISBN 5-469-01300-6

,
Pocket PC.
, -
, . ,
Pocket PC.
,
.
.

, 2006

.
.
, , , .
, ,
, .

ISBN 5-469-01300-6

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1. Pocket PC . . . . . . . . . . . . 13
Pocket PC . . . . . . . . . . . . . . . . . . . . . . . 13

. . . . . . . .
Windows CE Pocket PC . . . . . . . . . . . .
Pocket PC . . . . .
eMbedded Visual Tools 3.0 Pocket PC 2002 SDK . .
eMbedded Visual C++ 4.0 Pocket PC 2003 SDK . .
Visual Studio .NET 2003 . . . . . . . . . . . . .
Visual Studio 2005 . . . . . . . . . . . . . . .
. . . . . . . . . . . . . .
Pocket PC

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

14
14
18
18
19
20
20
22

2.
Pocket PC . . . . . . . . . . . . . . . . . . . . . . . 23
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
. . . . . . . . . . . . . . . . . . . . . . . . . . 24
. . . . . . . . . . . . . . . . . . . 25
. . . . . . . . . . . . . . . . . . . . . . . 26
Microsoft Loopback Adapter
. . . . . .
. . .
Platform Manager . . . .
ActiveSync . . . . . . . . . . . . . . .
ActiveSync . . . . . . .
CabWiz
. . . . . .

. . . . . .
. . . .
CECopy . . . . . . . . . . . .
Convert_PPC_DAT_to_SP_XML . . .
Hopper . . . . . . . . . . . . .
JShell . . . . . . . . . . . . .
PPC_Command_Shell . . . . . . .

Mobile Developer Power Toys

ActiveSync Remote Display

.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

26
27
27
28
31
32
33
34
34
34
35
35
36
36
37

RAPI_Debug

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

RAPI_Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
TypeIt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
. . . . . . . . . . . . . . . 39

3. Pocket PC
Microsoft eMbedded Visual Basic 3.0 . . . . . . . . . . 42
. . . . . . . . . . .
. . . . . . . . . . . . .
3.1. .
Standard . . . . . . . . . . . . . .
. . . . . . . . . . . . .
(Toolbox) .
3.2. . . . . .
. . . . . . . . . . . .
. . . . .
3.3. . . . . . .
. . . . . . . . . . . . . . . . . . . .

eMbedded Visual Basic 3.0

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

. .

. . . .
.
. . .
. . . . . . . . .

eVB

.
.
.
.
.

.
.
.
.
.

(Properties Window)
. . . . . . . . . . . . . .
Form

. . . . . . . . . . . .

3.4 . . . . . . . . . . . . .
3.5 . . . . . . . . . . . . .

. . . . .
ActiveX . . . . . . .
ActiveX . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

ActiveX
MenuBar . . . . . . . . . . . . . . .
3.6 . . . . . . . . . . . . . . . . .
eVB . . . . . . . . . . . . . . .
. . . . . . . . . . . .
3.7 . . . . . . . . . . . . . . . . .
. . . . . .
eVB CE API . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

42
44
45
47
48
48
49
50
51
52
54
56
56
57
58
59
61
61
62
62
65
69
73
76
76
77
79
79
92
94
94
95
95

eVB . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

4. Pocket PC
Microsoft eMbedded Visual C++ 3.0 . . . . . . . . . . 101
. . . . . . . . . . . . . . . . . . . . 101
4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

. . . . .
. . . . . . . . . .
4.1 () . .
. . . . . . . . . . . .

.
.
.
.
,
.
() .
.
4.1 () . .
.
4.1 () . .
.
. . . .
.
4.1 () . .
.
lvalue ( ) .
.
typedef . . . . . . . . . . . . .
.
. . . . . . . . . . .
.
. . . . . . . . . . .
.
. . . . . . . . . . .
.
. . . . . . . . . . . .
.
. . . . . . . . . . . .
.
4.1 () . .
.
. . . . . . . . . . .
.
4.1 () . .
.
. . . . . . . . . .
.
eMbedded Visual C++ 3.0
.
. . . . . . . . . . . . . .
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
4.2 . . . . . . . . . . . .
.
4.2 () . . . . .
.
4.2 () . . . . .
.
.
. . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
C .
4.3 . . . . . . . . . . . . . . . . . . .
4.3 () . . . . . . . . . . . .

C++

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

105
105
106
106
106
108
108
110
112
113
113
114
114
114
117
120
121
122
123
124
125
125
125
128
130
131
131
132
133
134
137
137
144

4.3 () . . . . . . . . . . . . . . . . . . . . 148
4.3 () . . . . . . . . . . . . . . . . . . . . 150
4.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Common Controls, . . . . . . . . . 155
4.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

. . . .
4.6 . . .
. .
. . . . . .
. . .
CommandBar

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

C++

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.



4.7 . . . . . . . . . .

. . . . . . . . . . .
4.7 () .
. . . . . . . .
.inf . . . . . .
4.8 . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

160
161
163
164
167
172
172
173
174
176
177
179
180
182

5. Pocket PC
Microsoft eMbedded Visual ++ 4.0 . . . . . . . . . . 185
- . . . . . . . . . . . . . . . . 185
, , , . . . . . . . . . 185
,

. . . . . . . . . . . . . . . . . . . 186

5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
5.1 () . . . . . . . . . . . . . . . . . . . . 191
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.1 () . . . . . . . . . . . . . . . . . . . . 192
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.1 () . . . . . . . . . . . . . . . . . . . . 195
. . . . . . . . . . . . . . . . . . . . . . . . . 196
5.1 () . . . . . . . . . . . . . . . . . . . . 196
. . . . . . . . . . . . . . . . . . . . . . . . . . 197
MFC . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

. . . . . . . . . . . . . . . . . . . . . . . . 198
MFC . . . . . . . . . . . . . . . . . . . . 201
5.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
MFC

6. .NET Compact Framework


Pocket PC Microsoft Visual Studio .NET 2003 . . 210
. . . .
.NET . . . . . . . . .
.NET . . . . .
.NET . . .
WebForms . . .
WindowsForms .
- . . . . . . .
.NET Compact Framework

.
.
.
.
.
.
.

.NET

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.


Common Intermediate Language . . . . . . . . . . .
Common language runtime . . . . . . . . . . . . . .
Common Language Specification
Common type system . . . . .
Common Language Infrastructure
Compact Framework

. . . . . . . .

Application domains . . . . . .
. . . . .
. . . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

210
211
211
212
212
212
212
212
212
213
213
213
214
214
214
214
214
214

.NET Framework
Compact Framework . . . . . . . . . . . . . . . . . . . . . . . 215
. . . . . . . . . . . . . . . . . 215
() CF . . . . . . . . . . . . . . . . . . . . 216
CF . . . . . . . . . . . . . . . . . 217
VB.NET: VB 6 . . . . . . . . . . . . . . . 218
eVB Visual Basic .NET . . . . . . . . . . . . . . . . . . . . . . 218

. . . . . .
. . . . . . . . . .
. . . . .
. .
XML .
VB.NET Compact Framework .
. .
6.1 . . . . .

.
.
.
.
.
.
.
.
.
.NET CF .
6.2 . . . . . . .
XML . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
6.2 () .

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

219
219
220
220
220
220
220
221
224
225
228
233
234

. . . . . . . . . . . . . . 242

6.2 () . . . . . . . . . . . . . . . . . . . . 243
DataSet . . . . . . . . . . . . . . . . . . . . . 246
6.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

SQL Server CE . . . . . . . . . .
6.4 . . . . . . . . . . . . .
6.5 . . . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
6.6 . . . . . . . . . . . . .
6.6 () . . . . . .
. . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

250
259
260
266
268
269
269
273
274

7.
. . . . . . . . . . . . . . 275
Pocket PC . . . . . . . . . . . . . . . . 275
Basic4PPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
NSBasic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Pelles C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
PPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Borland Delphi 2005 . . . . . . . . . . . . . . . . . . . . . . . . . . 284
On-Board
Pocket ViC . . . . . . . . . . . . . .
Python . . . . . . . . . . . . . . .
Scheme . . . . . . . . . . . . . . .
DSForth . . . . . . . . . . . . . . .
www.rainer-keuchel.de .
PGCC . . . . . . . . . . . . . . . .
Java . . . . . . . . .
Mysaifu JVM . . . . . . . . . . . . .

. . . .
. . . .
Jeode . . . . .
SuperWaba . .
Ewe . . . . .
Weme

CrEme

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

284
284
285
286
287
289
295
295
295
297
298
298
299
300

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

. , , , -, ZX-Spectrum, -0010 , , IBM


8086. , . ,
. IBM 486, 133 , 32 256 .
.
Pocket PC, . . , , . , , ,
. ,
. , , .
- , Palm, Palm, ,
Pocket PC. , -, , . , -. Pocket PC , .
Windows. ,
. , ,
.
,
Tetris, .
, Windows.
Linux ,
, , , .
, , ,
IBM 486, - . ,
Doom. , Doom , .

10

. , , . , ?
, , ,
Pocket PC? - ,
.
, , .
, ,
. . , ,
Pocket PC, QBackup,
.

.
Pocket PC , Java, Pocket PC
, .
, , Microsoft.
, Pocket PC. Microsoft , .
Visual Basic Visual C++,
. Assemler. ,
, . .
, , Pocket PC. ,
, Pocket PC
. ,
. , ,
. ,
Pocket PC , , ,
, .
,
. , , . ,

11

, , , Pocket PC. .


, ,
Pocket PC 2003. , Microsoft , , Pocket PC 2002,
Pocket PC 2003. Microsoft Visual Basic
Pocket PC 2003, , . eMbedded Visual Basic 3. eMbedded Visual C++ 3.
eMbedded Visual Tools 3.0 2002 Edition.
, .
1. - Microsoft, http://msdn.microsoft.com/mobility/downloads/updates/default.aspx.
2. Products & Updates eMbedded Visual Tools 3.0 - 2002 Edition .
3. , Download,
. evt2002web_min.exe. . ,
. , , Unzip To Folder,
Unzip.
4. setup.exe
. , .

evt2002web_min.exe ,
,
- . -
. .
, Download.
evt2002web_min.exe.

Pocket PC 2002 Pocket PC 2003.


Products & Updates eMbedded

12

Visual C++ 4.0. , .


Pocket PC. Microsoft ,
Pocket PC 2003. .NET. ,
.NET, Visual Studio 2003. ,
Microsoft, .
Visual Studio 2003, , .NET Pocket PC .
, .


,
comp@piter.com ( , ).
!
- :
http://www.piter.com.

Pocket PC
Pocket PC
, ,
, Pocket PC . , , ,
.
, Pocket PC ,
. Pocket PC , , , . ,
. Pocket PC
.
Pocket PC :
n TFT-. Pocket PC 320240 .
, , Pocket PC ,
.
n .
n .
n ( ).
n .
n .
n .
n .

14

1. Pocket PC

n .
n IRDA- .
n ( Pocket PC Wi-Fi ).
n .
n .
n .
n .
n ( ).
Pocket PC, ,

. ROM RAM.
Pocket PC . 80 % ARM, MIPS
SH. Microsoft
, x86, , - .
,
Windows CE, Microsoft
http://www.msembedded.ru/processors.aspx.

Pocket PC
Windows CE Pocket PC

. ,
, C, .
Pocket PC ,
. Windows CE 2.11, Windows CE 3.0, Windows CE 4.0,
Windows CE 4.1, Windows CE 4.2, Windows CE 5.0, Windows CE .NET, Pocket PC 2000, Pocket PC 2002, Windows Mobile 2003, Windows Mobile 2003 SE
Windows Mobile 5.0.
, Windows CE ,
, . , ,

Pocket PC

15

, , . Windows CE .
Windows CE .
, , , .
Pocket PC Windows Mobile for Pocket PC,
Microsoft Pocket PC. Windows Mobile Windows CE, .
1.1 ,
.
1.1. Pocket PC, Windows Mobile Windows CE

OS

Windows CE

Palm-size PC

Windows CE 2.11

2.11

Pocket PC 2000

Microsoft Pocket PC

3.0

Pocket PC 2002
Smartphone 2002

Microsoft Pocket PC 2002


Windows Mobile 2002

4.0

Pocket PC 2003
Smartfone 2003

Microsoft Pocket PC 2003


Windows Mobile 2003

4.20

Pocket PC 2003 SE
Smartfone 2003 SE

Microsoft Pocket PC 2003 SE


Windows Mobile 2002 SE

4.21

Windows Mobile 5.0

5.0

, Microsoft . Windows CE 3.0, , ,


OS. , Pocket
PC 2002, Pocket PC 2003 , .
Windows CE .NET Windows CE 4.x.
, Windows CE 4.0, Microsoft Windows CE .NET
Compact Framework (CF). Windows CE 4.0 CF Beta, 4.1 , 4.2 .NET Framework service pack 2.
, Pocket PC
, .
Windows Mobile (Windows CE) Win32 API ,
.

16

1. Pocket PC

, ,
. 1.1.

. 1.1. Windows Mobile Pocket PC

, ,
.
OAL (OEM Adaptation Layer) , , . OAL .
GWES (Graphics, Windowing, and Events Subsystem) (GDI, Graphics Device Interface) .
Windows CE API,
OS.
Core OS Interface , , , ,
, .
DLL , . Fiber , . Memory Management
. Power Management . Message Queue Point-to-Point
,
. Process and Thread
, .
Time ,

Pocket PC

17

. API ToolHelp , API


Pointer . Stylus
, . Authentication . ,
NTLM Kerberos. Cryptography . , , ,
, ertificates.
RAS API Dial-Up Networking ,
PPP. Fonts
, MLang
. - Pocket PC API Software-Based
Input Panel (SIP API).
JScript 5.5
. Active Directory Service
Lightweight Directory Access Protocol (LDAP). Multilingual
User Interface (MUI) . , . Message Queuing (MSMQ)
. Network User Interface (NetUI)
. API Object Exchange Protocol (OBEX)
, IrDA Bluetooth.

. Database
Windows CE, . , , .
File I/0 , , . API File Mapping
,
, .
File System Driver (FSD) (, ) . API Registry . Pocket Outlook Object Model (POOM)
Pocket Outlook ,
.
, .
API Windows Networking API/Redirector

18

1. Pocket PC

. Virtual Private Networking


Pocket PC , Waveform Audio . HTTP FTP WinSock API Windows
Internet Services (WinInet), , API Windows Sockets .
, Windows CE . ,
, Pocket PC,
, , Windows. , , , COM- Windows CE
, . . -
- , ,

32 .
Microsoft , Windows CE .
, ,
.


Pocket PC
Microsoft Pocket PC , , .
.
, Microsoft,
2005 Introduction to Development Tools for Windows Mobile-based Devices.
:
n eMbedded Visual Tools 3.0;
n eMbedded Visual C++ 4.0;
n Visual Studio .NET 2003;
n Visual Studio .NET 2005.

eMbedded Visual Tools 3.0 Pocket PC 2002 SDK


:
n eMbedded Visual Basic;
n eMbedded Visual C++ 3.0;

Pocket PC

19

n Pocket PC 2002 SDK;


n Smartfone 2002 SDK.
.
eMbedded Visual Basic
, Pocket PC 2002, Pocket PC 2003 Pocket PC 2003 SE,
.
, Microsoft , , , Pocket PC. eVB , ,
,
. , , , run-time ,
. , ActiveX.
eVB , . , , ,
.
eMbedded Visual C++ 3.0
, eVC 3.0, Pocket PC 2002 Pocket PC 2003 Pocket PC 2003 SE,
API.
, eVC 3.0, , , eVB. eVC . , ,
ActiveX. eVC
COM WinAPI, MFC ,
eVB . , , , API .
, Pocket PC .

eMbedded Visual C++ 4.0 Pocket PC 2003 SDK


eVC 4.0 Pocket PC 2003 SDK . , -

20

1. Pocket PC

Pocket PC 2003, Service Pack 2.


eVC 4.0
Pocket PC 2003 SE c VGA- 192 dpi ,
Service Pack 4,
Microsoft Mobile Application Development Toolkit Developer Resources
for Windows Mobile 2003 Second Edition.
Microsoft, eVC 4.0.
, eVC 3.0, eVC 4.0, ,
Pocket PC 2003 Pocket PC 2003 SE. eMbedded
Visual Basic Pocket PC 2003,
Microsoft, .
,
.NET CF, run-time
Visual Basic.

Visual Studio .NET 2003


, Visual Studio .NET 2003
Microsoft.
Microsoft ,
Pocket PC 2003.
Visual Basic .NET C#.
.NET Compact Framework.
. , Pacsal Java
. Visual Basic -, , . Visual Studio .NET
2003 . , Visual Studio
.NET 2003 . , ,
eVC.

Visual Studio 2005


Beta, Microsoft, SDK
(Windows Mobile SDK 5.0).
Visual Studio 2005, Microsoft , . Visual Studio 2005 .
n Windows Mobile 2003, Windows Mobile 2003
Second Edition Windows Mobile 5.0 C++.

21

Pocket PC

n .NET Compact Framework 1.0 Windows Mobile 2003, Windows Mobile


2003 Second Edition Windows Mobile 5.0 C# Visual Basic
.NET.
n .NET Compact Framework 2.0 Windows Mobile 5.0 C#
Visual Basic .NET.
1.2.
eMbedded Visual Tools 3.0
(2002 Edition)
eMbedded Visual
C++ 3.0

eMbeddedVisual
Basic 3.0

eMbedded
Visual C++
4.0 ( SP4)

Visual
Studio
.NET 2003

Visual
Studio
.NET 2005

SDK
Pocket PC 2000
Pocket PC 2002

Smartphone 2002

Windows Mobile
2003

Windows Mobile
2003 Second Edition

Windows Mobile 5.0

1.3. .NET Compact Framework


1.0

2.0


Visual Studio .NET 2003

Visual Studio 2005

Windows Mobile
Windows Mobile 5.0

(1.0 SP3)

Windows Mobile 2003 Second


Edition

(1.0 SP2)

(
Pocket PC)

Windows Mobile 2003

(1.0 SP1)

(
Pocket PC)

Smartphone 2002
Pocket PC 2002

Pocket PC 2000

22

1. Pocket PC

n .NET Compact Framework 2.0 Pocket PC


Windows Mobile 2003 C# Visual Basic .NET.
. 1.2 1.3.


Microsoft
, . , Microsoft .
.
1. Microsoft ActiveSync 4.0. ActiveSync 4.0
.
2. eMbedded Visual Tools 2002 Edition, Pocket PC 2002 SDK Smartphone 2002 SDK.
3. eMbedded Visual C++ 4.0 Service Pack 4.
4. Visual Studio .NET 2003.

Pocket PC 2003 Pocket PC 2003 .NET Compact Framework. .NET Compact Framework . .NET Compact Framework, ,
.

5. Pocket PC 2003 SDK.


6. ,
Pocket PC 2003 Second Edition.
7. Developer Resources for Windows Mobile 2003 Second Edition.
8. Visual Studio 2005.
9. Windows Mobile 5.0 SDK.


Pocket PC
, , Microsoft, ,
, .
Pocket PC, ActiveSync, CabWiz,
ActiveSync, Emulator
ActiveSync Connection Tool, ,
, Windows Mobile Developer
Power Toys.

. . .

Pocket
PC. , ,
, Pocket PC .
,
.
, Microsoft
SDK for Pocket PC 2003. , , . ,
.

24

2. Pocket PC


Microsoft Windows Pocket PC 2003 SDK eMbedded Visual C++ 4.0 (Service Pack 2),
Visual Studio .NET 2003.
.
SDK
(. 2.1).

. 2.1. Pocket PC 2003 SDK

Pocket PC 2003 Emulator, (. 2.2):

. 2.2. Pocket PC 2003

25


, , , emul.cmd. .
start "" "C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\ Platman\
bin\PBEmulator.exe" /MemorySize 64 /Fastbackground /Skin "C:\Program Files\Windows CE
Tools\wce420\POCKET PC 2003\Emulation\pocket_pc_emulator_skin.xml" /CEImage
"C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Emulation\ PPC_2003_WWE.bin"
/VMName "POCKET PC 2003 - POCKET PC 2003 Emulator" /HostKey 165

, . , .
n /Video . . , (skin), .
.
80 1024 , 64 768 , 8, 16 32.
n /Ethernet .
Ethernet . None, Shared, Virtualswitch media access control (MAC)
. , .
,
, MAC-.
.
q None .
q Shared ( IP-),
.
, , .
q Virtualswitch IP-
DHCP ,
, .
n /Skin . ,
. XML,
.
n /CEImage . . , .
n /MemorySize . , . .
32 256 .
Pocket PC 2003 64 .

26

2. Pocket PC

n /Fastbackground .
, .
n /HostKey . , , . .
n /VMName , , . ,
. , .
n /VMID ,
(GUID) . ,
.


,
,
, .
n : Microsoft Windows 2000 Professional Windows 2000
Server Service Pack 2, Microsoft Windows XP Home Edition
Windows XP Professional.
n Intel Pentium II 400 .
n 196 .
n Microsoft Loopback Adapter.

. . , , ,
.

Microsoft Loopback Adapter


Microsoft Loopback Adapter
, , . Microsoft Loopback Adapter
.
1. 44 .
2. .
3. , ,
.

27

4. .
5. , .
6. .
7. Microsoft .
, , .
. , . .
Virtual PC Emulated Ethernet Switch.
.


, , Pocket PC. .
1. , , TCP\IP.
2. x86. , , ,
. ,
ARM
.
Pocket PC, .
3. Pocket PC. .
4. , ,
.
5. , .



.
n Host + F ,
, .
.
n Host + P .

28

2. Pocket PC

n Host + R
.
n Host + T .
n Host + F4 .


Save Emulator State.
, , . . . C:\Documents and Settings\_\Application Data
.vsv (, {31F6C796-7FD5-43AC-A8C2-A7CDB8C00A3B}.vsv).
.

Host , /HostKey .
. 2.1.
2.1.
HostKey

ALT

164

CTRL

162

SHIFT

160

Windows logo

91

ALT

165

CTRL

163

SHIFT

161

Windows logo

92

Platform Manager
.
.
Platform Manager
(),
. Platform Manager C:\Program Files\
Common Files\Microsoft Shared\Windows CE Tools\Platman\bin\wce420. Platform Manager Microsoft, Pocket PC Windows CE,
Configure Windows CE Platform Manager,
.

29

C:\Program Files\Common Files\Microsoft Shared\


Windows CE Tools\Platman\bin\wce420 cefilevw.exe. .
, Connection4Configure Windows CE Platform
Manager.
(. 2.3).

. 2.3.

Pocket PC 2003 Emulator, Properties. (. 2.4).

. 2.4. Pocket PC 2003

30

2. Pocket PC

Transport TCP\IP Transport For


Windows CE, Startup Server Emulator Startup Server. Configure, Startup Server,
(. 2.5).

. 2.5.

, .
n Device4Image , .
Pocket PC 2003 Pocket PC 2003 Phone Edition .
n Video4Skin ,
. Phone Edition .
n System4HostKey HostKey.
n Communication .
q Ethernet NAT. Virtual
Switch .
q Serial Port 1 COM-
.

ActiveSync

31

q Serial Port 2 COM-


.
q Parallel Port
.

OK. Test. , - . , Cancel Testing Device Connection OK.
.

ActiveSync
ActiveSync , (Pocket PC) (. 2.6).

. 2.6. ActiveSync

ActiveSync. ,
, .
ActiveSync
, ,
Pocket PC.
, ActiveSync Pocket Outlook
. , ActiveSyn , .

32

2. Pocket PC

1. , .
.
2. ,
.
3. .
, ActiveSync ,
, . SDK , . C:\Program Files\Windows CE
Tools\wce420\POCKET PC 2003\Activesync.
. ActiveSync
, .
ActiveSync ,
.

ActiveSync
ActiveSync , .
1. Microsoft Loopback Adapter.
2. Microsoft .NET Framework 1.1 SDK .
Microsoft . Visual Studio .NET, SDK .

. 2.7.

3. Platform Manager.
q , TCP\IP Use Fixed Address.

CabWiz

33

q Startup Server Emulator Starup Server Communication4Ethernet Virtual Switch.


q Platform Manager.
4. ActiveSync.
44Microsoft Pocket PC 2003 SDK4
Pocket PC 2003 SDK. .
EmuASCfg.exe /PPC Enter. , (. 2.7).

EmuASCfg.exe /PPC , ActiveSync.

CabWiz


, . .
1. , .
2. , , .
3. .
4. , - .
5. - .
6. .
7. .
8. . ,
.
9. . , ,
, .
AppInstall (
), CabWiz, ( .cab), Pocket PC.
CabWiz , ,
.

34

2. Pocket PC


CabWiz.exe C:\Program Files\Windows CE Tools\
wce420\POCKET PC 2003\Tools. abWiz.exe .
cabwiz.exe "inf_file" [/dest dest_directory] [/err error_file][/cpu cpu_type [cpu_type]]
[/platform platform_label [platform_label]]

.
inf_file ( , ) .inf, , CabWiz .
, .cab, dest_directory. , .cab
, .
, , error_file. ,
. cpu_type
, .
C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Target.
, ,
, /cpu ARMV4 X86. platform_label , .cab. . 2.2.
2.2. platform_label.

platform_label

Pocket PC 2003 device

2577

Pocket PC 2003 emulator

686

Pocket PC 2002 device

2577

Pocket PC 2002 emulator

686

Mobile Developer Power Toys


, , Microsoft, . .

ActiveSync Remote Display


Pocket PC . ,
, . Remote

Mobile Developer Power Toys

35

Display , ,
. , Pocket PC . . 2.8.

. 2.8. ActiveSync Remote Display

CECopy
, ActiveSync. ,
ActiveSync ,
Mobile
Developer Power Toys.
.
CeCopy [ ] <> <>

/is ,
, /s
, . , cecopy /s *.dll dev:\windows
.dll windows Pocket PC.

Convert_PPC_DAT_to_SP_XML
Convert_PPC_DAT_to_SP_XML .cab
Pocket PC ,
.

36

2. Pocket PC

Hopper

- .
. - .

.
Hopper
.

JShell
. ,
. . 2.9.

. 2.9. JShell

,
.
.

Mobile Developer Power Toys

37

n -r <cmd> <cmd>.
n -f 60 , .
n -m mi
4 . miXXX.txt \My Documents,
XXX -.
n -w win
4 . winXXX.txt \My Documents, XXX -.
, (. . 2.9), . , !.
JShell.
.
n win .
n gi proc .
n kp # , #.
n gi thrd .
n gi mod (DLL).
n gi mod "xx" (DLL), xx.
n mi .
n mi full .
n s <app> <args> , <app>.

PPC_Command_Shell
,
(. 2.10).
arm Windows
Pocket PC cmd.exe.
, help Enter.

RAPI_Debug
. bugtrap.exe Windows, RapiDbg.exe
. , ActiveSyn. RapiDbg.exe -

38

2. Pocket PC

( , ),
, ,
Pocket PC.
. 2.11.

. 2.10.

. 2.11.

39

RAPI_Start

Pocket PC, ActiveSync.
, RAPI_Start
iexplore.exe http://yandex.ru/, Pocket PC Pocket Explorer
.

TypeIt
.
.

, , Pocket PC.
, , ,
. Pocket PC ,
. Pocket PC
. , , .

. ,
Pocket PC .

. , . , , ,
, ,
Microsoft Outlook.
(Greg Keyser),
Microsoft, Microsoft
Mobile DevCon 2004 . .
1. ,
. , . .

40

2. Pocket PC

, , Pocket PC
,
, (. 2.12).

. 2.12.

, , ( ).
2. , , (,
) .
3.
.
q , .
q Pocket PC ,
,
.
q ,
, .
q
.
4.
44 .
5. 8 .
6. 20 .
7. (. 2.13) .
q .
q . .
q .
q 8 .

41

8. ,
, .
q
.
q 5
.
q 10
. . 2.14 , .

. 2.13.

. 2.14.

9. , .
10. . ,
, .

Pocket PC.


Pocket PC Microsoft
eMbedded Visual Basic 3.0

eMbedded Visual Basic 3.0
eMbedded Visual Basic 3.0
eVB.
eVB (44
Microsoft eMbedded Visual Tools4eMbedded Visual Basic 3.0), (
C:\Program Files\Microsoft eMbedded Tools\EVB\ EVB3.EXE). (. 3.1).

. 3.1.

eMbedded Visual Basic 3.0

43

Windows CE for PocketPC


.
, .
.
eVB , (. 3.2).

. 3.2.


. . ,
, (. 3.3).

. 3.3.

44

3. Pocket PC Visual Basic 3.0

,
.

, , (SDI), ,
Tools4Options4General4SDI Development
Enviroment.



Toolbars View. (. 3.4).

. 3.4. Toolbars

.
n Debug .
n Edit .
n Form Editor .
n Standard .
n Customize
(. 3.5).

. 3.5.

eMbedded Visual Basic 3.0

45

Toolbars ,
. , Shortcut Menus, .
New , ,
.

3.1.

1. View4Toolbars4Customize. ,
. 3.5.
2. New.
3. MyTB.
4. Close. . ,
, (. 3.6).

. 3.6.

5. , .
6. Customize.
Commands. ,
.
, ,
. , MyTB (. 3.7).
,

. , Customize Modify Selection. (. 3.8).
.
n Reset .
n Delete .
n Name .
n Copy Button Image
.

46

3. Pocket PC Visual Basic 3.0

. 3.7.

. 3.8.

n Paste Button Image


.
n Reset Button Image .
n Edit Button Image . .
n Change Button Image .
n Default Style
.

eMbedded Visual Basic 3.0

47

n Text Only (Always) , .


n Text Only (In menus) ,
,
.
n Image and Text ,
, .
n Begin a Group , , .
, .
, .
Customize Options , .
n Large icons .
n Show ScreenTips on Toolbars
.
n Show ShortCut Key on ScreenTips .
n Menu Animations
.

Standard
, .
n
, .
n

n
, .
n
,
, .
n
(Undo) (Redo).
n
.
,
,
.

48

3. Pocket PC Visual Basic 3.0

n
,
.
n
.

, -

n
.

Project Explorer -

n
.


, eVB, .
, .
,
.
, . Docable . Docable , .
Hide .
View.


(Toolbox)
(. 3.9).

. 3.9. eVB

.
eVB,
General. ,

eMbedded Visual Basic 3.0

49

. eVB ActiveX, ActiveX, . ActiveX ,


eVB Windows API .

3.2.

1. .
(. 3.10).

. 3.10.

2. Add Tab.
ActiveX, . ActiveX
.
3. ActiveX .
, , . ,
Components.

(. 3.11).
Controls ,
.
, Browse ,
,
Windows CE.
4. ,
Controls.
.
5. , .
6. , Rename Tab Delete Tab ,
.

50

3. Pocket PC Visual Basic 3.0

. 3.11.

, ActiveX , .
.


, .
1. . .
2. ( ) ,
, .
, .
3. . , .
, Ctrl.

- , , . -

eMbedded Visual Basic 3.0

51

,
,
.

Delete.
, . ,
.
Shift. ,
Alt.
,
.
, ,
Shift.


.
eVB , Format.
.
n Align .
q Lefts .
q Centers .
q Rights
.
q Tops
.
q Middles .
q Bottoms
.
q To Grid
. , Tools4Options4General Align Controls to Grid. ,
,
.
n Make same size .

52

3. Pocket PC Visual Basic 3.0

q Width
.
q Heigth
.
q Both , .
n Size to Grid .
n Horizontal Spacing
.
q Make Equal
. .
q Increase
.
q Decrease
.
q Remove
.
n Vertical Spacing
. , Horizontal Spacing.
n Center in form .
. , .
n Order .
q Bring to front
.
q Send to Back
.
n Lock Controls
.

3.3.

1. Shape, Label,
Timer , . 3.12.
2. Command1
.
. , 3.1.

eMbedded Visual Basic 3.0

53

3.1
Private Sub Command1_Click()
Label1.Font.Size = 20
Label1.Font.Bold = True
Label1.WordWrap = True
Label1.Alignment = vbCenter
Label1.Caption = ", !"
Timer1.Interval = 300
Timer1.Enabled = True
Shape1.FillColor = &HFF&
Shape2.FillColor = &HFF&
Shape3.FillColor = &HFF&
End Sub

. 3.12.

3. Timer1
3.2.
3.2
Private Sub Timer1_Timer()
If (Shape1.FillStyle = 1) Then
Shape1.FillStyle = 0
Shape2.FillStyle = 0
Shape3.FillStyle = 0
Else
Shape1.FillStyle = 1
Shape2.FillStyle = 1
Shape3.FillStyle = 1
End If
End Sub

4. Pocket PC 2002 (. 3.13).

. 3.13.

54

3. Pocket PC Visual Basic 3.0

5. Run4Execute
Ctrl+F5. , .
6. Command1. , !,
(. 3.14).

. 3.14.


Tools4Options eVB.
.
Editor
.
n Auto Syntax Check .
n Require Variable Declaration Option Explicit,
.
n Auto List Members .
n Auto Quick Info
.
n Auto Data Tips .
n Auto Indent
.

eMbedded Visual Basic 3.0

55

n Tab Width .
n Drag-and-Drop Text Editing .
n Default to Full Module View
, .
n Procedure Separator , .
Editor Format
.
n Code Colors ,
.
(Foreground), (Background) (Indicator),
, .
n Font .
n Size .
n Margin indicator bar .
General
,
.
n Show Grid .
n Width . 2
60 .
n Height . 2
60 .
n Align Controls to Grid .
n Show ToolTips ,
.
n Collapse Proj. Hides Windows ,
,
.
n SDI Development Environment , , .

56

3. Pocket PC Visual Basic 3.0

Docking
. , ,
Docable .
Environment
,
.
n Prompt for project
eVB.
n Save Changes
.
n Prompt To Save Changes

.
n Do not Save Changes ,
.
n Show Templates For , Add, Standard.
n Templates Directory , .

. .

eVB , ,
. , Microsoft Visual Studio Borland
Delphi, eVB . .



File. .
n New Project . .
eVB . , .
n Open Project , ,
.
n Save Project .

. .

57

n Save Project As , .
n Save .
n Save As ,
.
n Print ,
Print Setup.
n Print Setup .
n Make Project ,
eVB,
.vb.
n List of Recently-Used Projects , .
n Exit eVB.


,
.
n .ebp ,
, ,
. ,
. , ,
.
n .ebf .
, , .
n .frx . , , .
, , .
n .bas .
, .
n .ocx , ActiveX, eVB.
n .vbw eVB. .
n , ,
.
, , Project Explorer, . 3.15.

58

3. Pocket PC Visual Basic 3.0

. 3.15. Project Explorer

, . .
.
,
, , .
. (Form2 Form3), , .
.
Project Explorer . . .
n View Object View Code, View Code.
n Print, , .
.
n Remove, .


Visual Basic . .vb. ,
, .
.vb Pocket PC -, VB . , .vb
.
Pocket PC 2002 VB
, , .
Pocket PC 2003 . -

. .

59

http://msdn.microsoft.com/mobility/windowsmobile/downloads/
evb_eula.aspx Microsoft
msvbppc. .cab
PocketPC, .
VB .
, Pocket PC 2003 Pocket PC 2002,
Pocket PC 2003.
,
Ctrl+F5 Run4Execute. , (. 3.13).


, ,
Project4Properties. . Project4
Properties (. 3.16).

. 3.16.

, General.
n Project Type .
.
n Project Name . , . , .

60

3. Pocket PC Visual Basic 3.0

n Project Description . , .
n Startup Object , , .
.
n Remote Path , . \Windows\
Start Menu\,
(. 3.17).

. 3.17. \Windows\Start Menu\

n Run on Target , .
Pocket PC 2002.
n Configure Target Platform
Manager, .
n Frequency .
n Always Ask , , .
n Component to Update , ,
, .
q Runtime Files VB.
q Project Components ActiveX, .
Make ,
. Platform
,
.

eVB

61

eVB
(Properties Window)

. . 3.18.

. 3.18.


.
.
1. . .
2. .
3. .
4. . . , ShowOK,
, ShowOK. .
5. ,
.
, 2 (. . 3.18)
, 3, .

62

3. Pocket PC Visual Basic 3.0


eVB .
1. .
.

2. ,
. .

3. . . .
,
.

Form
Form
Form . 3.1.
3.1. Form


Show

Hide

Move

ZOrder

SetFocus


Refresh

Cls

DrawCircle

DrawLine

Point

PointSet

eVB

63

( )
SetScale

ScaleX

ScaleY

TextHeight

, ,

TextWidth

, ,

Form
. 3.2 Form.
3.2. Form

ActiveControl

AutoRedraw

true,
,
false,

BackColor

BorderStyle

Caption

ClipControls

false, ,
, , .
true,

CurrentX


( )

CurrentY

( )

DrawMode

( )

DrawStyle


(, , . .),
DrawWidth=1. ,

DrawWidth

Enabled

FillColor

FillStyle

Font

Font

FontBold

64

3. Pocket PC Visual Basic 3.0

FontItalic

FontName

FontSize

FontStrikethru

FontTransparent

FontUnderline

ForeColor

( )

FormResize

. 0 , , . 1
, ,
. 2 ,
,

HDC

Height

HWnd

KeyPreview

true , ( )
, ,

Left

Moveable

Name

ScaleHeight

. ScaleHeight=50
50 ,

ScaleLeft

ScaleMode

ScaleTop

ScaleWidth

ShowOK

true

SIPBehavior

. 0 , . 1 , .
2 ,

SIPVisible

Tag

, ,

Top

Visible

Width

WindowState

. 0
, 1 , 2

eVB

65

Form
Form.
. 3.3.
3.3. Form

Activate

Deactivate

, , . .

GotFocus

,
. ,

KeyDown

KeyPress

, -

KeyUp

Load

LostFocus

MouseDown

MouseMove

MouseUp

OKClick

OK

Paint

QueryUnload

Resize

SIPChange

Terminate

3.4
Form.
1. FormMethods,
FormMethods.ebp. Form1.
2. AddForm,
Form2.
3. Form1 , . 3.19.
4. , Form1 true
AutoRedraw 20 DrawWidth.
.
5. Project Explorer Form2.
. 3.4.
.

66

3. Pocket PC Visual Basic 3.0

. 3.19. Form1
3.4. Form2

AutoRedraw

true

BackColor

BorderStyle

None

DrawWidth

10

FormResize

vbFormUserSize

Height

2000

Width

2000

6. . Form2 Timer, . 3.20.

. 3.20. Form2

7. Timer1 Interval 150.


8. Timer1 , 3.3.

eVB

67

3.3
Private Sub Timer1_Timer()
i = i + a
j = j + b
If i > 1600 Then a = -a: BackColor = &HFF&:
DrawCircle 500, 500, 400, &HFF00FF:
DrawLine 1100, 1100, 1800, 1800, &HFF00FF, vbLineBoxFill
If j > 2500 Then b = -b: BackColor = &HFFFF&:
DrawCircle 500, 500, 400, &HFF00FF:
DrawLine 1100, 1100, 1800, 1800, &HFF00FF, vbLineBoxFill
If i < 0 Then a = -a: BackColor = &HFF00&:
DrawCircle 500, 500, 400, &HFF00FF:
DrawLine 1100, 1100, 1800, 1800, &HFF00FF, vbLineBoxFill
If j < 0 Then b = -b: BackColor = &HFF0000:
DrawCircle 500, 500, 400, &HFF00FF:
DrawLine 1100, 1100, 1800, 1800, &HFF00FF, vbLineBoxFill
Move i, j
End Sub

DrawCircle, DrawLine Move


, Form2 .
9.
Option Explicit , 3.4.
3.4
Dim
i =
j =
a =
b =

a, b, i, j
0
0
100
50

10. Project Explorer Form1. Command1 Command2 Caption .


11. Command1
, 3.5.
3.5
Private Sub Command1_Click()
If ShFrm2 Then
Form2.Show
ShFrm2 = False
Command1.Caption = ""
Else
Form2.Hide
ShFrm2 = True
Command1.Caption = ""
End If
End Sub

68

3. Pocket PC Visual Basic 3.0

Show Hide
Form2 Command1.
12. Command2
, 3.6.
3.6
Private Sub Command2_Click()
Cls
Form2.ZOrder vbBringToFront
End Sub

Cls Form1 , ZOrder Form2 . , Form1.


13. , 3.7.
3.7
Private Sub
DrawLine
DrawLine
DrawLine
End Sub

Form_Load()
1100, 1100, 9000, 18000, &HFF&
1100, 1100, 18000, 10000, &HFF&
1100, 1100, 18000, 18000, &HFF&

Form1 .
14. , .
, 3.8.
3.8
Option Explicit
Dim ShFrm2 As Boolean
ShFrm2 = True

15. .
Pocket PC 2002 Emulation, Run4
Execute. Form1
.
Form2 , (. 3.21).
Form2 . ,
Form1. Form2. ,
.

eVB

69

. 3.21. FormMethods

3.5
, Form.
1. FormEvents.
2. TextBox, ListBox CommandButton
, . 3.22.

. 3.22.

3.
. . 3.5.
3.5.

Command1.Caption

Command1.Caption

Command1.Caption

70

3. Pocket PC Visual Basic 3.0

4. .
. 3.6.
3.6.

BackColor

BorderStyle

Sizable

ControlBox

true

Height

3000

Left

1000

Top

1000

Width

3000

5. Project Explorer Form1.


, View Code , 3.9.
3.9
Rem Form2
Private Sub Command1_Click()
Form2.Show
End Sub
Rem Form2
Private Sub Command2_Click()
Form2.Hide
End Sub
Rem Form2
Private Sub Command3_Click()
If Form2.Height > 2500 Then
Form2.Height = 1000: Form2.Width = 1000
Else
Form2.Height = 3000: Form2.Width = 3000
End If
End Sub
Private Sub Form_OKClick()
App.End
End Sub
Rem
Private Sub List1_DblClick()
List1.Clear
End Sub
Rem
Private Sub Form_SIPChange(ByVal IsV As Boolean)
If IsV Then
List1.AddItem " "
Else
List1.AddItem " "
End If
End Sub

eVB

71

Rem
Private Sub Form_KeyDown(ByVal KeyCode As Integer, ByVal shift As Integer)
List1.AddItem "Text1_KeyDown"
End Sub
Private Sub Form_KeyPress(ByVal KeyAscii As Integer)
List1.AddItem "Text1_KeyPress"
End Sub
Private Sub Form_KeyUp(ByVal KeyCode As Integer, ByVal shift As Integer)
List1.AddItem "Text1_KeyUp"
End Sub
Private Sub Form_MouseDown(ByVal button As Integer, ByVal shift As Integer, x, y)
List1.AddItem "Form_MouseDown"
End Sub
Private Sub Form_MouseUp(ByVal button As Integer, ByVal shift As Integer,
_x, y)
List1.AddItem "Form_MouseUp"
End Sub
Rem ,
Rem
Private Sub Form_MouseMove(ByVal button As Integer, ByVal shift As Integer, x, y)
If button = 1 Then List1.AddItem "Form_MouseMove"
End Sub

6. Project Explorer Form2. ,


3.10.
3.10
Private Sub Form_QueryUnload(ByVal cancel As Integer, unloadmode)
Form1.List1.AddItem "Form2 QueryUnload"
End Sub
Private Sub Form_Activate()
Form1.List1.AddItem "Form2
End Sub
Private Sub Form_Deactivate()
Form1.List1.AddItem "Form2
End Sub
Private Sub Form_GotFocus()
Form1.List1.AddItem "Form2
End Sub
Private Sub Form_LostFocus()
Form1.List1.AddItem "Form2
End Sub
Private Sub Form_Paint()
Form1.List1.AddItem "Form2
End Sub

Activate"
Deactivate"
"
"
"

Private Sub Form_Load()


Form1.List1.AddItem "Form2 "
End Sub
Private Sub Form_Resize()
Form1.List1.AddItem " Form2 Resize"
End Sub

72

3. Pocket PC Visual Basic 3.0

7. Run4Execute .
.
8. 1 , ListBox ,
.
9. Form2 , .
, .
10. 3. Form1, Form2 . ,
Form2 , , ,
. , , .
11. 2. , .
12. . 3. Form2 . , ,
.
13. Form1 . ,
.
14. TextBox . .
. - , ,
, Down.
Down, Press Up. eVB ,
, Microsoft.
15. .
16. ,
Form2 Hide
. QueryUnload.

, eVB, ,
. , ( ) .
, ,
,
, ,
.

17. , , QueryUnload, 3.11.

eVB

73

3.11
Private Sub Form_QueryUnload(cancel, unloadmode)
Form1.List1.AddItem "Form2 QueryUnload"
cancel = 0
End Sub
Private Sub Form_Unload(cancel)
Form1.List1.AddItem "Form2 Unload"
End Sub

cancel , , , . , , . ,
, , .

Unload cancel = 0,
.


. 3.23 eVB. .
.

. 3.23. eVB

1. Shape.
(, , , ,
). Shape. Move, Refresh ZOrder Shape . Shape
.
Shape .
2. Line. ,
. . Move
Line ,
.
3. Label. .
Caption
1024 . Autosize (
) WordWrap (-

74

3. Pocket PC Visual Basic 3.0

, ,
).
Font
Alignment. Label Change, Caption.

Move, Refresh ZOrder.
4. TextBox. .
Text. MultiLine
.
2048 ,
32 .
( Font) ( Alignment).
, ScrollBars. Text
, , , .
SelLength (
), SelStart ( , ) SelText (, ). ,
. ,
(KeyDown, KeyPress KeyUp). ,
eVB . 3.5.
5. Frame. -,
. . . Frame
OptionButton, .
6. CommandButton. , . Click CommandButton.
7. CheckBox. , .
Value. 0 , , 1 , , 2 , .
CheckBox Click,
Value, ,
.
8. OptionButton. , , . -

eVB

75

, OptionButton
CheckBox. ,
, OptionButton,
.
9. ComboBox. , , .
.
, ,
Custom.
(ListData) (ItemData). ,
ListData,
ItemData . Style .
(SelLength, SelStart, SelText), TextBox.

. List , . ListCount
. ListIndex . NewIndex , TopIndex
.
. , Sorted true
. AddItem RemoveItem,
. Clear
.
ComboBox . Change

. Click .
Scroll.
10. ListBox. ComboBox
TextBox ListBox, , ,
ListBox. ListBox .
,
. ,
ListBox .
MultiSelect 1 2 .
11. HScrollBar. . ,

76

3. Pocket PC Visual Basic 3.0

. Max , Value.
. Min , Value. Value ,
. LargeChange , ,
. SmallChange . ,
Scrollbar Scroll ( ) Change ( Value ).
12. VScrollBar. . HScrollBar.
13. Timer. Timer , Interval.
Interval 1 65 535.
, Enabled
false.
eVB , , .
, , , .
.
, , . ActiveX. ActiveX ,
eVB . Visual Basic COM-,
, ActiveX.

ActiveX
ActiveX
ActiveX , .
Project4Components Ctrl+T. ActiveX- (. . 3.11).
,
, OK. . . 3.24 , MenuBar Control.

ActiveX

77

. 3.24. MenuBar,


ActiveX
,
, ActiveX COM-, , .

. , eVB.
. , .
n Project4Project Properties.
n General Frequency Always,
Component to Update Project Components.

ActiveX .
, , , . , ,
.
ActiveX
Control Manager.
.
n Tools4Remote Tools4Control Manager. , . 3.25.
n ,
( Pocket PC 2002 Emulation).
, -

78

3. Pocket PC Visual Basic 3.0

( Microsoft CE Grid Control).


Install to Target. .

. 3.25. Control Manager

, . ( File Viewer ActiveSync), RegSvrCE.exe.


C:\Windows CE Files\wce300\Pocket PC 2002\target\arm C:\Windows CE
Files\wce300\Pocket PC 2002\target\x86. arm
, x86 . . arm x86 C:\Program
File\Windows CE Files\wce300\Pocket PC 2002\controls.
n , RegSvrCE.exe , , , RegSvrCE.exe. , . 3.26.
n ,
, Register OK.
n , (. 3.27).
. ,
.
.
.
.

ActiveX

79

. 3.26. RegSvrCE.exe

. 3.27.

MenuBar

Pocket PC.
, . , . , .
.
Enabled . false.
NewButton true,
New. .

3.6
1. EnPhrase
EnPhrase.ebp.

80

3. Pocket PC Visual Basic 3.0

2. Caption , Height 7050. , , VScrollBar.


3. Frame. 3.7.
3.7. Frame

Height

4050

LargeChange

1000

Left

3360

Max

3000

Min

SmallChange

100

Width

255

4. Label. . 3.8.
3.8. Label1, Label2 Label3

Label1

Label2

Label3

BackStyle

BorderStyle

Caption

""

""

""

Height

1000

1000

1000

Left

120

120

120

Top

300

1350

1350

Width

3135

3135

3135

WordWrap

true

true

true

5. CommandButton.
. 3.9.
3.9. Command1, Command2, Command3 Command4

Command1

Command2

Command3

Command4

Caption

<

Height

375

375

375

375

Left

120

960

1800

2250

Top

2520

2520

2520

2520

Width

735

735

350

1000

6. ListBox.
. 3.10.

ActiveX

81

3.10. ListBox

Columns

Font

Tahoma, bold, 10

Height

30

Left

120

MultiSelect

Top

3000

Width

3135

7. .
, . 3.28.

. 3.28.

8. , , ,
, Change VScroll. 3.12.
3.12
Private Sub VScroll1_Change()
Frame1.Top = -200 - VScroll1.Value
End Sub

82

3. Pocket PC Visual Basic 3.0

,
.
Value , , . -200 ,
.
9. , .
Project4Components Microsoft Pocket PC MenuBar Control.
Project4Project Properties|Update Components4Always|Component to Updates4Project Components.
10. , , MenuBar . NewButton false.
.
, , , . Form_Load().
11. ,
MenuBar. (
MenuBarMenu) ( MenuBarButton), Pocket PC. MenuBar,
, Collection,
, ImageList, ,
. ButtonClick, MenuClick NewClick , New .

AddButton AddMenu Collection.
, , .
12. Form_Load(). 3.13. ,
. .
3.13
Rem 1
Dim mnuFile As MenuBarMenu
Rem 2
Dim mnuSep, mnuClr1, mnuClr2, mnuClr3 As MenuBarButton
Rem 3
Set mnuFile = MenuBar1.Controls.AddMenu("", "mnuFile")
Rem 4
mnuFile.Items.Add 1, "itFont", " "

ActiveX

83

Rem 5
mnuFile.Items.Item(1).SubItems.Add 1, "itBold", ""
mnuFile.Items.Item(1).SubItems.Add 2, "itItal", ""
mnuFile.Items.Item(1).SubItems.Add 3, "itSize", ""
Rem 6
mnuFile.Items.Item(1).SubItems.Item(3).SubItems.Add 1, "it8", "* 8"
mnuFile.Items.Item(1).SubItems.Item(3).SubItems.Add 2, "it10", "10"
mnuFile.Items.Item(1).SubItems.Item(3).SubItems.Add 3, "it12", "12"
Rem 7
mnuFile.Items.Add 2, "", ""
mnuFile.Items.Item(2).Style = mbrMenuSeparator
Rem 8
mnuFile.Items.Add 3, "itOpen", ""
Rem 9
mnuFile.Items.Add 5, "", ""
mnuFile.Items.Item(5).Style = mbrMenuSeparator
Rem 10
mnuFile.Items.Add 6, "itExit", " "
Rem 11
Set mnuSep = MenuBar1.Controls.AddButton("mnuSep")
mnuSep.Style = mbrSeparator
Rem 12
Set mnuClr1 = MenuBar1.Controls.AddButton("1")
mnuClr1.Style = mbrButtonGroup
mnuClr1.Caption = " 1 "
Set mnuClr2 = MenuBar1.Controls.AddButton("2")
mnuClr2.Style = mbrButtonGroup
mnuClr2.Caption = " 2 "
Set mnuClr3 = MenuBar1.Controls.AddButton("3")
mnuClr3.Style = mbrButtonGroup
mnuClr3.Caption = " 3 "
Rem 13
Frame1.Top = -200
List1.Clear
End Sub

13. . .
1) MenuBarMenu. , ,
.
2) MenuBarButton. , , .
3) MenuBarMenu .
mnuFile, ,
,
mnuFile.
4) , Items. Add, .
. Add (1), (itFont) ,
. ,

84

3. Pocket PC Visual Basic 3.0

, ,
Item.
5) .
SubItems. Add.

, .
6) 8, 10 12. 8 ,
.
7) , ,
,
.
8) .
9) .
10) .
11) . (mbrSeparator). , .
12) .
mbrButtonGroup. , .
13) .
.
14.
. 3.14.
3.14
Private Sub MenuBar1_ButtonClick(ByVal Button As MenuBarLib.MenuBarButton)
Select Case Button.Key
Case "1"
Label1.BackColor = &H80000005
Label2.BackColor = &H80000005
Label3.BackColor = &H80000005
List1.BackColor = &H80000005
Case "2"
Label1.BackColor = &HC0FFFF
Label2.BackColor = &HC0FFFF
Label3.BackColor = &HC0FFFF
List1.BackColor = &HC0FFFF
Case "3"
Label1.BackColor = &HC0FFC0
Label2.BackColor = &HC0FFC0
Label3.BackColor = &HC0FFC0
List1.BackColor = &HC0FFC0
End Select
End Sub

ActiveX

85

ButtonClick
Button, (Button.Key) ,
. Select
. , .
15. , , 3.15.
3.15
Private Sub MenuBar1_MenuClick(ByVal Menu As MenuBarLib.MenuBarMenu)
Select Case Menu.Key
Case "itExit"
App.End
End Select
End Sub

MenuClick
Select ( )
.
16. .
,
. , . 3.29.

. 3.29.

17. ActiveX Microsoft CE Image List Control. .


MenuBar, ImageList , .
18. ImageList, .
.

86

3. Pocket PC Visual Basic 3.0

1616, 256 , white.bmp,


yellow.bmp green.bmp. 1414 , , . .
19. Project4Add File. , , All Files (*.*), Add As Related Document,
OK.
.
. ,
, . 3.30.

. 3.30.

20. ImageList. Form_Load() , 3.16.


3.16
Dim imLst As ImageList
Set imLst = ImageList1
imLst.Add "\Windows\Start Menu\white.bmp"
imLst.Add "\Windows\Start Menu\yellow.bmp"
imLst.Add "\Windows\Start Menu\green.bmp"
MenuBar1.ImageList = imLst.hImageList

ImageList.
ImageList1,
. MenuBar1. .
\Windows\Start Menu\, .
21. , Caption ,
Caption . ImageList
MenuBar Form_Load,
ImageList, 3.17.

ActiveX

87

3.17
Rem
mnuClr1.Caption = " 1 "
mnuClr1.Image = 1

Rem
mnuClr2.Caption = " 2 "
mnuClr2.Image = 2

Rem
mnuClr3.Caption = " 3 "
mnuClr3.Image = 3

22. , .
23. ,
,
,
, , ,
ListBox.
24. .
, phrase.txt . 3.18.
3.18
Kak dela
Vsego horoshego
Do vstrechi
how are you
good luck
see you later

25. , .
, . Pocket PC 2003 .
26. , ActiveX File
System Common Dialog. ,
. File System
File FileSystem. FileSystem , , , , , .
, File,
,
.
27.
, 3.19.
3.19
Option Explicit
Dim intText, intInt, intStep, intCount As Integer
Dim varText, varEnText

88

3. Pocket PC Visual Basic 3.0

Dim
Rem
Dim
Set
Rem
Dim
Set

varStrng As String
File
flFile As File
flFile = File1

fdOpen As CommonDialog
fdOpen = CommonDialog1

28. . Private Sub MenuBar1_


MenuClick Case. ,
3.20.
3.20
Private Sub MenuBar1_MenuClick(ByVal Menu As MenuBarLib.MenuBarMenu)
Select Case Menu.Key
Case "itExit"
App.End
Case "itOpen"
Rem 1
fdOpen.ShowOpen
Rem 2
If fdOpen.FileName <> "" Then
Rem 3
flFile.Open fdOpen.FileName, fsModeInput, , , 1
Rem 4
intText = 0
While Not flFile.EOF
intText = intText + 1
flFile.LineInputString
Wend
Rem 5
flFile.Close
flFile.Open fdOpen.FileName, fsModeInput, , , 1
Rem 6
For intCount = 1 To intText
varText = flFile.LineInputString
If intCount > intText/2 Then varEnText=varEnText +" "+varText
Next
intStep = 1
flFile.Close
Rem 7
flFile.Open fdOpen.FileName, fsModeInput, , , 1
For intCount = 1 To intText
varText = flFile.LineInputString
If intCount = intStep Then Label1.Caption = varText
If intCount = intStep+intText/2 Then Label2.Caption=varText
Next
Rem 8
intStep = 2
flFile.Close
Dim strAr
Dim strSt As String
Rem 9
varEnText = Trim(varEnText)
Rem 10
strAr = Split(varEnText, " ", -1, vbTextCompare)

ActiveX

89

Rem 11
intInt = 10000
For intCount = 0 To intInt
On Error Resume Next
List1.AddItem strAr(intCount)
If Err.Number Then
Err.Clear: Exit For
End If
Next
Rem 12
Dim intCount2 As Integer
For intCount = 1 To List1.ListCount
For intCount2 = intCount + 1 To List1.ListCount
If (StrComp(List1.List(intCount), List1.List(intCount2), vbTextCompare) = 0)
Then
List1.RemoveItem (intCount2): intCount2=intCount2-1
End If
Next
Next
End If
End Select
End Sub

, .
1) .
2) ,
3.
3) File.
4) intText,
.
5) LineInputString
.
6)
varEnText.
7) Label1, Label2.
8) .
9) .
10) varEnText ,
strAr. , ,
.
11) intInt , 10 000 .
List1 , .
, On Error Resume
Next. Err.Number , Err.Clear ,
Exit For .
12) .

90

3. Pocket PC Visual Basic 3.0

29. . .
30. , Label3. 3.21.
3.21
Private Sub List1_Click()
varStrng = Label3.Caption
Label3.Caption = Label3.Caption + List1.List(List1.ListIndex) + " "
End Sub

Label3 varStrng.
31. Caption Label3
, 3.22.
3.22
Private Sub Command2_Click()
Label3.Caption = ""
End Sub

32. ,
3.23.
3.23
Private Sub Command3_Click()
Label3.Caption = varStrng
End Sub

33. . Label2 Label3, . ,


3.24.
3.24
Private Sub Command4_MouseDown(button, shift, x, y)
Label2.ZOrder vbBringToFront
End Sub
Private Sub Command4_MouseUp(button, shift, x, y)
Label2.ZOrder vbSendToBack
End Sub

34. .

, , . , 3.25.
3.25
Private Sub Command1_Click()
If intText <> 0 Then
If StrComp(Trim(Label2.Caption), Trim(Label3.Caption), vbTextCompare) = 0 Then

ActiveX

91

MsgBox ", ! ! ", vbOKOnly


flFile.Open fdOpen.FileName, fsModeInput, , , 1
For intCount = 1 To intText
varText = flFile.LineInputString
If intCount = intStep Then Label1.Caption = varText
If intCount = intStep + intText / 2 Then Label2.Caption = varText
Next
flFile.Close
Label3.Caption = ""
If intStep > intText / 2 Then
MsgBox " ", vbOKOnly
App.End
End If
intStep = intStep + 1
Else
MsgBox " , ", vbOKOnly
End If
End If
End Sub

35. .
.
MenuBar1_MenuClick
Case, 3.26.
3.26
Case "itBold"
If mnuFile.Items.Item(1).SubItems(1).Caption = "" Then
Label1.FontBold = True
Label2.FontBold = True
Label3.FontBold = True
List1.FontBold = True
mnuFile.Items.Item(1).SubItems(1).Caption = "*"
Else
Label1.FontBold = False
Label2.FontBold = False
Label3.FontBold = False
List1.FontBold = False
mnuFile.Items.Item(1).SubItems(1).Caption = ""
End If
Case "itItal"
If mnuFile.Items.Item(1).SubItems(2).Caption = "" Then
Label1.FontItalic = True
Label2.FontItalic = True
Label3.FontItalic = True
List1.FontItalic = True
mnuFile.Items.Item(1).SubItems(2).Caption = "*"
Else
Label1.FontItalic = False
Label2.FontItalic = False
Label3.FontItalic = False
List1.FontItalic = False
mnuFile.Items.Item(1).SubItems(2).Caption = ""
End If
Case "it8"
If mnuFile.Items.Item(1).SubItems(3).SubItems(1).Caption = "8" Then

92

3. Pocket PC Visual Basic 3.0

3.26 ()
Label1.FontSize = 8
Label2.FontSize = 8
Label3.FontSize = 8
List1.FontSize = 8
mnuFile.Items.Item(1).SubItems(3).SubItems(1).Caption
mnuFile.Items.Item(1).SubItems(3).SubItems(2).Caption
mnuFile.Items.Item(1).SubItems(3).SubItems(3).Caption
End If
Case "it10"
If mnuFile.Items.Item(1).SubItems(3).SubItems(2).Caption
Label1.FontSize = 10
Label2.FontSize = 10
Label3.FontSize = 10
List1.FontSize = 10
mnuFile.Items.Item(1).SubItems(3).SubItems(1).Caption
mnuFile.Items.Item(1).SubItems(3).SubItems(2).Caption
mnuFile.Items.Item(1).SubItems(3).SubItems(3).Caption
End If
Case "it12"
If mnuFile.Items.Item(1).SubItems(3).SubItems(3).Caption
Label1.FontSize = 12
Label2.FontSize = 12
Label3.FontSize = 12
List1.FontSize = 12
mnuFile.Items.Item(1).SubItems(3).SubItems(1).Caption
mnuFile.Items.Item(1).SubItems(3).SubItems(2).Caption
mnuFile.Items.Item(1).SubItems(3).SubItems(3).Caption
End If

= "*8"
= "10"
= "12"

= "10" Then

= "8"
= "*10"
= "12"

= "12" Then

= "8"
= "10"
= "*12"

36. . , . . ,
. , , .
- ,
. , ,
, - .

eVB
, , ,
, , , .
,
.
,
Tools4Remote Tools4Application Install Wizard.

.
1. .
2. .ebp

eVB

93

3. , .vb. ,
. ,
File4Make Project.vb.
4. ,
. , .
C:\MyInstall.
5. Arm 1100 (4K) v 3.00.
6. ,
. , , .
7. ,
. white.bmp, green.bmp,
yellow.bmp phrase.txt. , Is this a System file? , .
,
Windows . Pocket
PC 2002, Include Device Runtime in Cab file. Pocket PC 2003 , , , Pocket PC 2003 VB.
8. 4 . Default Install Directory , . EnPhrase. Application Name
, . EnPhrase.
Description . Company Name , .
, .
9. Create Install.
.
C:\MyInstall\CD1. , .
, , . ,
\Windows\Start Menu\, . . , eVB. ,
, 3.27.
App.Path , .

94

3. Pocket PC Visual Basic 3.0

Pocket PC,
phrase.txt, .
, C:\MyInstall\CD1 Setup.exe.
3.27
Dim imLst As ImageList
Set imLst = ImageList1
MsgBox App.Path, vbOKOnly
imLst.Add (App.Path + "\white.bmp")
imLst.Add (App.Path + "\yellow.bmp")
imLst.Add (App.Path + "\green.bmp")
MenuBar1.ImageList = imLst.hImageList


, , ,
.
. .

3.7
1. . File4New Project
Windows CE Formless
Project.
2. ,
, 3.28.
3.28
Option Explicit
Sub Main()
End Sub

3. FLess.ebp. , 3.29.
3.29
Sub Main()
MsgBox " ", vbOKOnly
End Sub

4. . , OK .
5. Main .
eVB .
. , ,
, , .

95


6. , . ,
3.30.
3.30
Sub Main()
If MsgBox(" ?", vbYesNo) = vbYes Then
Form1.Show
Else
App.End
End If
End Sub

7. , , 3.31.
3.31
Private Sub Form_OKClick()
App.End
End Sub

8. , , .
No ,
Yes .

eVB CE API
, eVB , ActiveX ,
. , eVB , Windows CE, CE API.
CE API
declare , .
CE API PlaySound
If, . 3.32.
Option Explicit Coredll.dll PlaySoundW, PlaySound.
, Pocket PC.
CE API
WCESDKR.CHM, \Windows CE Files\Htmlhelp\emtools SDK. WINCEAPI.TXT ( Windows CE Files\BIN SDK),
CE API.

96

3. Pocket PC Visual Basic 3.0

3.32
Option Explicit
Declare Function PlaySound Lib "Coredll" Alias "PlaySoundW" (ByVal lpszName As String,
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Sub Main()
If MsgBox(" ? ", vbYesNo) = vbYes Then
Form1.Show
Else
PlaySound "Alarm1.wav", 0, 0
PlaySound "Alarm2.wav", 0, 0
PlaySound "Alarm3.wav", 0, 0
PlaySound "Alarm4.wav", 0, 0
App.End
End If
End Sub

eVB
eVB .

. ,
Devices, Pocket PC.
, , . eVB .

3.8
1. , 3.7, , 3.33.
3.33
Sub Main()
Dim A, B As Integer
Dim C As Double
If MsgBox(" ?", vbYesNo) = vbYes Then
Form1.Show
Else
PlaySound "Alarm1.wav", 0, 0
PlaySound "Alarm2.wav", 0, 0
PlaySound "Alarm3.wav", 0, 0
PlaySound "Alarm4.wav", 0, 0
A = 10
B = 20
C = Mult(A, B)
App.End
End If
End Sub
Function Mult(ByVal One, Two As Integer) As Double
One = One + 5

eVB

97

Two = Two - 3
Mult = (One * 10 + Two * 10) / Add(One, Two)
End Function
Function Add(ByVal my1, my2 As Integer) As Double
Add = Sqr(my1) + Sqr(my2)
End Function

2. A, B C.
Mult() Add(), Main(). ,
( )
. .
3. , . ,
(. 3.31).

. 3.31.

.
1) ;
2) ;
3) ;
4) ;
5) ;
6) ;
7) ;
8) ;
9) ;
10) .
4. . ,
(. 3.32).
Toggle4Breakpoint.
, .
(3)
.

98

3. Pocket PC Visual Basic 3.0

, ,
, .

. 3.32.

, . (
) (
).
5. A = 10. , .
F5, . , ,
, ,
.

Shift+F8,
F8. , ,
.
6. , .

. Watch
Window. View4Watch Window, Watches, .
Watches,

eVB

99

Add Watch. (. 3.33).

. 3.33. Watches

Watches , ,
, ,
Form1.Color. Watches . .

. 3.34 Watches .

. 3.34. Watches

, Quick Watch.
, . , (. 3.35).

. 3.35. Quick Watch

, , . , (. 3.36).

100

3. Pocket PC Visual Basic 3.0

. 3.36.

Watches , . 3.34,
.

( ) , . ,
Watches ,
.

(Immediate Window)
eVB. View4Immediate Window.
Basic , .
Immediate Enter,
. , ? < >, ?B.
, Immediate,
.
, Immediate, MsgBox " !", vbOKOnly Enter. .
.
,
, (. 3.37).

. 3.37.


Pocket PC Microsoft
eMbedded Visual C++ 3.0
eVB C++, , . eVB ,
eVC ( eMbedded Visual
C++ 3.0), eVB , C++.
eVC ,
, , . , eVC . , eVC eVB Delphi,
.
. . ,
,
.
. eVC, ,
eVC++ 4.0
Pocket PC 2003.


, eVC,
++. ++, - ,
, .
, ,
++,

102

4. Pocket PC Visual C++ 3.0

eVC. .

4.1
1. eVC File4New.
New. Projects
WCE Pocket PC 2002 Application.
Project Name MyExp. OK.
2.
An Empty Project Finish.
3. File4New.
Files C++ Source File. Add To Project MyExp.
4. File4New. ,
, Files C/++
Header File. Add To Project MyExp. eVC. .
5. MyExp.h , 4.1.
4.1
// 1
#define dim(x) (sizeof(x) / sizeof(x[0]))
// 2
struct decodeUINT {
UINT Code;
LRESULT (*Fxn)(HWND, UINT, WPARAM, LPARAM);
};
// 3
struct decodeCMD {
UINT Code;
LRESULT (*Fxn)(HWND, WORD, HWND, WORD);
};
// 4
int InitApp (HINSTANCE);
int InitInstance (HINSTANCE, LPWSTR, int);
int TermInstance (HINSTANCE, int);
int MyPaint (HWND, UINT, WPARAM, LPARAM);
// 5
LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);
// 6
LRESULT DoDestroyMain (HWND, UINT, WPARAM, LPARAM);
LRESULT CharRec (HWND, UINT, WPARAM, LPARAM);

Save All .
.

6. MyExp.cpp , 4.2.

4.2
// 1
#include <windows.h>
#include "MyExp.h"
// 2
const TCHAR szAppName[] = TEXT ("MyExp");
HINSTANCE hInst;
const struct decodeUINT MainMessages[] = {
WM_DESTROY, DoDestroyMain,
WM_CHAR, CharRec,
};
// 3
wchar_t *szStr;
// 4
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPWSTR lpCmdLine, int nCmdShow) {
MSG msg;
int rc = 0;
rc = InitApp (hInstance);
if (rc) return rc;
if ((rc = InitInstance (hInstance, lpCmdLine, nCmdShow)) != 0)
return rc;
while (GetMessage (&msg, NULL, 0, 0)) {
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return TermInstance (hInstance, msg.wParam);
}
// 5
int InitApp (HINSTANCE hInstance) {
WNDCLASS wc;
HWND hWnd = FindWindow (szAppName, NULL);
if (hWnd) {
SetForegroundWindow ((HWND)(((DWORD)hWnd) | 0x01));
return -1;
}
wc.style = 0;
wc.lpfnWndProc = MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = NULL,
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = szAppName;
if (RegisterClass (&wc) == 0) return 1;
return 0;
}
// 6
int InitInstance (HINSTANCE hInstance, LPWSTR lpCmdLine, int nCmdShow){
HWND hWnd;
hInst = hInstance;
hWnd = CreateWindow (szAppName,
TEXT("My Experimental Programm"),
WS_VISIBLE,

103

104

4. Pocket PC Visual C++ 3.0

CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
if ((!hWnd) || (!IsWindow (hWnd))) return 0x10;
ShowWindow (hWnd, nCmdShow);
UpdateWindow (hWnd);
return 0;
}
// 7
int TermInstance (HINSTANCE hInstance, int nDefRC) {
return nDefRC;
}
// 8
LRESULT CALLBACK MainWndProc (HWND hWnd, UINT wMsg, WPARAM wParam,
LPARAM lParam) {
INT i;
for (i = 0; i < dim(MainMessages); i++) {
if (wMsg == MainMessages[i].Code)
return (*MainMessages[i].Fxn)(hWnd, wMsg, wParam, lParam);
}
return DefWindowProc (hWnd, wMsg, wParam, lParam);
}
// 9
LRESULT DoDestroyMain (HWND hWnd, UINT wMsg, WPARAM wParam,
LPARAM lParam) {
PostQuitMessage (0);
return 0;
}
// 10
LRESULT DoCharRecieveMain (HWND hWnd, UINT wMsg, WPARAM wParam,
LPARAM lParam) {
HDC hdc;
PAINTSTRUCT ps;
RECT rectCli;
GetClientRect (hWnd, &rectCli);
ps.rcPaint = rectCli;
InvalidateRect (hWnd, &rectCli, true);
hdc = BeginPaint (hWnd, &ps);
szStr = L"GiGoGa";
DrawText (hdc, (const unsigned short *)szStr, -1, &rectCli,
DT_CENTER | DT_SINGLELINE);
EndPaint (hWnd, &ps);
return 0;
}
// 11
LRESULT CharRec (HWND hWnd, UINT wMsg, WPARAM wParam,
LPARAM lParam) {
switch ((TCHAR)wParam){
case 49 : { szStr = L" 1 ";}
break;
case 50: { szStr = L" 2";}
break;
}
MyPaint (hWnd, wMsg, wParam, lParam);

C++

105

return 0;
}
// 12
int MyPaint (HWND hWnd, UINT wMsg, WPARAM wParam,
LPARAM lParam) {
HDC hdc;
PAINTSTRUCT ps;
RECT rectCli;
GetClientRect (hWnd, &rectCli);
ps.rcPaint = rectCli;
InvalidateRect (hWnd, &rectCli, true);
hdc = BeginPaint (hWnd, &ps);
DrawText (hdc, (const unsigned short *)szStr, -1, &rectCli,
DT_LEFT | DT_WORDBREAK);
EndPaint (hWnd, &ps);
return 0;
}

7. , . , , eVB
. eVC
.
, .
Windows , . , , Windwos CE ,
. C++
eVC. Execute Programm
. 1 2 .

C++

.
, ,
, . ,
, ,
.

.
//

, .
/*

*/

106

4. Pocket PC Visual C++ 3.0

.
ASCII.
,
.
, ASCII, .

4.1 ()
8. MyExp.cpp 3
():
wchar_t mstr[256];

9. , 4.3.
4.3
// 13
void f1(){
mstr[0]=' ';
for (unsigned short i = 22; i<127; i++){
mstr[i-21]=i;
}
}

10. 11, 4.4.


4.4.
case 49 : {
f1();
szStr = mstr;}
break;

11. MyExp.h 4.
void f1();

12. . 1 ASCII, , , .

.
, , , , . , ,
, ,
.

,
,
. .

C++

107

. , , x=y+f(2);. ,
, x, y f,
, ,
, .
() C++
. ,
.
, :
float x;
int y;
float f(int);

, ,
. , - , , f. , , int
float.
, , .
, . , .
.
.
.
:
int x, y, z;

++ .
, C++, .
n (bool).
n (char, wchar_t).
n (short, int, long).
n (float, double).
n (enum).
n void .
n .
n .
n .
n .
MyExp.cpp . , 3 :

108

4. Pocket PC Visual C++ 3.0

wchar_t *szStr; // szStr,


// (*) wchar_t
wchar_t mstr[256]; // mstr wchar_t
// 256

4 :
MSG msg; // msg MSG
int rc = 0; // rc int,
// 0

()

(true) (false).
.
. false true 0 1.
, , . .

4.1 ()
13. MyExp.h 4
void f2();.
14. MyExp.pp 3
:
char mm[256];
charnn[32];

15. MyExp.pp 14, ,


4.5.
4.5
// 14
void f2(){
bool i = false;
int j = 10;
mm[0] = '\0';
sprintf(nn, "%d", j);
strcat(mm, " j = ");
strcat(mm, nn);
strcat(mm, "\n");
i=7;
sprintf(nn, "%d", i);
strcat(mm, " i = ");
strcat(mm, nn);
strcat(mm, "\n");
j = j+i;
sprintf(nn, "%d", j);
strcat(mm, " j+i = ");
strcat(mm, nn);
strcat(mm, "\n");

C++

109

mbstowcs(mstr, mm, 256);


szStr = mstr;
}

16. case 11, 4.6.


4.6
case 50: {
f2();
}
break;

case
switch.

. 2 .
, j 10
. 7 i bool 7 , i j 11, 17.

char ,
. 8 ,
256 . ,
, 26
.
.
, . char
(signed char), (unsigned char). char
, ,
unsigned char.
, Unicode,
wchar_t.
. ,
. ,
, ESC-,
. ESC- .
'\n' ,
'\t' ,
'\v' ,
'\r' ,
'\f' ,

110

4. Pocket PC Visual C++ 3.0

'\a' ,
'\'' (),
'\"' ,
'\\' .


int, short int long int. short long. ,
signed unsigned. int . ,
unsigned. unsigned unsigned int. .

float ( ), double
( ) long double ( ).
.

++ .
char. ,
char ,
sizeof, .

4.1 ()
17. MyExp.h f3() 11
case, 4.7.
4.7
case 51: {
f3();
}
break;

18. MyExp.cpp ,
4.8.
4.8
// 15
void f3(){
mm[0] = '\0';
sprintf(nn, "%d",
strcat(mm, " Size
strcat(mm, nn);
strcat(mm, "\n");
sprintf(nn, "%d",
strcat(mm, " Size
strcat(mm, nn);

(sizeof(char)));
of type char = ");
(sizeof(wchar_t)));
of type wchar_t = ");

C++

111

strcat(mm, "\n");
sprintf(nn, "%d", (sizeof "Hello, Word!"));
strcat(mm, " Size of string \"Hello, Word!\" = ");
strcat(mm, nn);
strcat(mm, "\n");
mbstowcs(mstr, mm, 256);
szStr = mstr;
}

3.

, . bool true false,


char , .

, . . .
00, 02, 077. 0x 0x0,
0x2, 0x3f.
U 23U,
L long 23L.
,
.
:
n 1.23
n .23
n 0.23
n 1.
n 1.0
n 1.2e10
n 1.23e-10
. , double. float, f 2.9999f.
Void
, .
void. , , , ,
.
.
void f(); //
void* pnt; //
void x; // , void

112

4. Pocket PC Visual C++ 3.0

, . enum. :
enum {DEC, JAN, FEB};

. , ,
.
DEC 0, JAN 1, FEB 2.
, :
enum year{JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC};

,
, :
enum times{SAVE=10,SLEEP=20,STOP=30};

,
, ,
, , . STOP 21.
enum times{SAVE=10,SLEEP=20,STOP};


. , , , , ,
.
, ( ),
, ,
. , .
, .
, .
, , , (
) .
.

. . ::.
. .

C++

113

4.1 ()
19. , 4.9. case.
4.9
// 16
void f4(){
// mm,
// char, , .
// 0, , . ,
// strcat, Hello, Global
//Word! \n.
mm[0] = '\0';
strcat(mm, "Hello, Global Word! \n");
// mm, mm.
// mm, ,
// . Hello,
//Local Word!
char mm[256];
mm[0] = '\0';
strcat(mm, "Hello, Local Word! \n");
// mm,
// mm,
// ::
strcat(mm, ::mm);
mbstowcs(mstr, mm, 256);
szStr = mstr;
}

. 4. :
Hello, Local Word!
Hello, Global Word!

, , ,
.
n , ,
, .
n .
n , .
n , .
n .
n .

lvalue ( )

, . ++

114

4. Pocket PC Visual C++ 3.0

, .
, lvalue, , . , lvalue. lvalue.
, ,
.
. , ,
, , .
, new,
delete, .
.

typedef
, typedef, .
typedef char* Pchar;


. , typedef
.

, ,
. ++, . ,
, , .
, , C/C++, Operator Precedence and Associativity, .
C++.

, ,
.

.
. 4.1.
, .
:
int x=1, y=0;
y = x++; // y x (1), x 1
y = ++x; // x 1,
//

C++

115

++x = 5. x++ = 5
, 5 .
4.1.

++

??


.
n & . 1, 1,
0.
n | . 1,
1, 0.
n ^ . 1 , 0, 1, 0.
n ~ ,
.
n >> . ,
0, .
n << . ,
.

? . .
E1?E2:E3

E1. true,
E2, E3 . E1 false, E3, E2 . , a = (x>y)?x:y .

. 4.2.

true, , false, . = = != , .

116

4. Pocket PC Visual C++ 3.0

4.2.

<

>

>=

<=

==

!=


C++ . 4.3.
4.3.

&&

. true , (true),
false. false
0,

||

. true, (true), false.


true ( 0),

. true,
false, false

,
* .
, . , , .
& () , .
, , , . , . .

n () . , , . ,
.
.
n {} .
, .
n [] .

C++

117

n sizeof int, ,
. ,
.
n . , s.m, s , m
.
n -> ,
s->m, s
, m .
C C++
n :: - , -
. - - .
n .* .
n ->* .
n const_cast const,
, , .
n dynamic_cast ,
.
n reinterpret_cast
.
n static_cast , , .
,
(, int double),
static_cast .
n typeid -.
n new .
n delete , new.
n this ,
.
n ~ .

++ , .
, . , . , ,

118

4. Pocket PC Visual C++ 3.0

, .
, , , .
ifelse
,
. : . .
if ( <condition> ) <statement1>;

.
if ( <condition> ) <statement1>;
else <statement2>;

(if) (<condition>) bool true, <statement1>,


<statement2>. 4.10.
4.10
void fother () {
char mstr[20] ;
mstr[0]='\0';
int a = 5;
if (a>5) // a>5
{
strcat(mstr, "a>5"); // "a>5"
}
else //
{
if (a =5) // =5
{
strcat(mstr, "a=5"); // "a=5"
}
else //
{
strcat(mstr, "a<5"); // "a<5"
};
};
}

ifelse. , .
, , .
switch ()
,
.
:
switch ( <switch variable> ) {
case <constant expression> : <statement>; [break;]
default : <statement>;
}

C++

119

, switch.
case, , . ,
case, default.
break,
. default switch. switch 11 . , .
while
while ,
. . .
while ( <condition> ) <statement>

statement , condition. .
while (*p == ' ') p++;

do while
do while ,
.
.
do <statement> while ( <condition> )

statement ,
condition.
for
for . .
for ( <initialization>] ; <condition>] ; <increment>] ) <statement>

<initialization> , <condition> , <increment> . <statement> . <condition>, . for .


for (int i = 0; i < 10; i++){
sprintf(nn, "%d", i);
strcat(mm, nn);
strcat(mm, " ");
}

break
break switch, for, while do
.

120

4. Pocket PC Visual C++ 3.0

continue
.
goto
goto , .
. ,
,
.
.
identifier:

goto <identifier> ;

return

, . . .
return [ <expression> ] ;

.
double sqr(double x)
{
return (x*x);
}

, , .
, .
. . , .
, . . , ,
.
++ . .
, - .
, void*.
,
, .
. 0
.

C++

121

.
type *ptr;

, . type , .
,
, .
. .
n void .
n void.
n
.
n .
n
.
. , , , C++ , .
n .
, .
n , ,
.
n .

.
type declarator <constant-expression>]

, constant-expression
type.
.
float v[3]; // v[0], v[1], v[2]
char* a[32]; // 32 char a[0]a[31]

. , .
int d[10][20];

d 20 int
.

122

4. Pocket PC Visual C++ 3.0

.
int v1[] = {1, 3, 5, 7};
char v2[] = {'a','b','d','l',0};

, . ,
. ,
.
. C++, ,
, , , 4 .
.
, .
,
,
.

, .
C++ . , , , ,
,
. ,
.

, , ,
, ,
. .

4.1 ()
20. MyExp.cpp , 4.11.
. case.
4.11
// 17
void f5(){
mm[0] = '\0';
// 9
char p[]="Crocodile!";
//
for (int i = 0;i<10; sprintf(nn,"%c", p[i]),strcat(mm, nn),i++);
strcat(mm,"\n");
// ,
// ( ), ,

C++

123

//
for (char* t=p;*t!=0; sprintf(nn,"%u", *t), strcat(mm, nn),
strcat(mm," "),t++);
strcat(mm,"\n");
// ,
// ,
for (char* s=p;*s!=0; sprintf(nn,"%p", s), strcat(mm, nn), strcat(mm,"\n"),s++);
mbstowcs(mstr, mm, 256);
szStr = mstr;
}

.
, . for
, .
, ,
. .

++
.
struct, .
struct mystruct { ... };

,
, . ++ .

, .
struct mystruct{ ... } s, *ps, arrs[10];
mystruct s1;

. , .
.
:
struct { ... } s, *ps, arrs[10];

typedef , .
typedef struct { ... } MYSTRUCT;
MYSTRUCT s, *ps, arrs[10];

typedef , - .

. , ,
.
C++ .

124

4. Pocket PC Visual C++ 3.0



, (, ).
:
type-specifier <bitfield-id> : width;

++ .
, ,
, .
, , .
n , , ,
.
n mystruct.x , & mystruct.x ,
mystruct.x .
n , ,
.
, , .
,
, .

4.1 ()
21. ,
4.12.
4.12
// 18
void f6(){
mm[0] = '\0';
struct mystruct {
int d;
double e;
unsigned short mybit: 2;
mystruct* s;
int myfunc(int g)
{return g*g;};} mystr;
mystruct* pmy = &mystr;
mystr.s = pmy;
mystr.d = 100;
pmy->e = 300.00;
mystr.mybit = 3;
sprintf(nn,"%f", pmy->e);
strcat(mm, nn);
strcat(mm, " - pmy->e\n");
sprintf(nn,"%d", mystr.d);
strcat(mm, nn);

eMbedded Visual C++ 3.0

125

strcat(mm, " - mystr.d\n");


sprintf(nn,"%p", mystr.s);
strcat(mm, nn);
strcat(mm, " - mystr.s\n");
sprintf(nn,"%d", mystr.myfunc(12));
strcat(mm, nn);
strcat(mm, " - mystr.myfunc(12)\n");
sprintf(nn,"%d", pmy->myfunc(12));
strcat(mm, nn);
strcat(mm, " - pmy->myfunc(12)\n");
sprintf(nn,"%d", mystr.mybit);
strcat(mm, nn);
strcat(mm, " - mystr.mybit\n");
mbstowcs(mstr, mm, 256);
szStr = mstr;
}

6 .

union.
,
,
.

variant. , , . .
, .


, , . . , .


eMbedded Visual C++ 3.0
, eVC
, . .

SDI, .
, .
(. 4.1).

126

4. Pocket PC Visual C++ 3.0

. 4.1.


. Workspace (. 4.2).

. 4.2. Workspace

Workspase .
, Workspase FileView. , ClassView, -
, ResourceView . , ,
, .
,
. FileView,
.
ClassView, , .
. , Workspace .

eMbedded Visual C++ 3.0

127

Output (. 4.3) .

. 4.3. Output

, .
n Build
, , .
n Debug , .
n Find in Files1 Find in Files2 .

. .
eVC Docked,
, Undocked,
. Docking View Tools4Options4Workspace4Docking Views.
, .
Docking.
Workspace Output Hide,
.
View4Workspace (View4Output). .
n

/ Workspace.

/ Output.

n
Window. .
n New Window . ,
.

128

4. Pocket PC Visual C++ 3.0

n Split . ,
.
, .
.
n Docking View Docking/UnDocking
.
n Close .
n Close All .
n Next, Prevouse . .
n Cascade, Tile Horizontally, Tile Vertically ,
.
n Windows


eVC .
. , Tools4Customize. (. 4.4).

. 4.4. Customize

, .
Commands
Commands , .

eMbedded Visual C++ 3.0

129

,
.
n Category, . , , Buttons.
n Show Menu for ,
. All Menus, , Customize ,
.
n Modify Selection .
, .
n Reset All Menus ,
.
Buttons ,
.
Toolbars
. Toolbars . Show Tooltip, With Shortcut Key Large Buttons
,
. Delete, New, Reset Reset All
, , .
Tools
,
. New, Menu Contents , Command , Arguments
, Initial directory ,
.
.
Keyboard

. .
n Category File.
n Command ApplicationExit.
n Editor Main.
n Press new shortcut key,
Alt+X. .
n Assign. Alt+X Current keys.

130

4. Pocket PC Visual C++ 3.0

n Close, Customize,
Alt+X. .
Add-In and macro files
n , Tools4Record
Quick Macro Tools4Macro
, VBScript. .


eV . . .
File
File.
.
n New . , .
n Open .
, .
n Close .
n Open Workspace
. .vcw .dcw.
n Save Workspace .
n Close Workspace
.
n Save .
n Save As .
n Save All .
n Page Setup .
n Print .
n Recent Files .
n Recent Workspaces .
n Exit .

workspace, .

eMbedded Visual C++ 3.0

131

. .vcw
,
.
, . .

4.2
1. , File4Close workspace.
2. File4New
, ,
Workspaces.
3. Workspace Name MyWSP, OK. .
.
, .
,
, .
. .
,
.
n , . .

4.2 ()
4. File4New. Projects WCE Pocket PC 2002
Application.
5. Project Name FirstPrApp,
Add to current workspace.
6. OK. .
. An empty project
.
. A Simple Windows CE application
Windows CE. A typical "Hello Word" application , Hello, Word!
. Finish. .
7. FileView Workspace
FirstPrApp.
ReadMe.txt.
.

132

4. Pocket PC Visual C++ 3.0

FirstPrApp.vcp . ,
. ,
, .
.vcp
eVC NMAKE, .
FirstPrApp.cpp . . WinMain
.
.cpp, ,
WinMain, . .cpp ( ) .
FirstPrApp.h FirstPrApp.cpp. ,
. .h.
FirstPrApp.rc . , (, , , . .).
FirstPrApp.ico , .
StdAfx.h, StdAfx.cpp, Newres.h ,
. , . , , ,
.
Resource.h .
n , Microsoft Foundation Classes,
, . ,
.

n .cpp .h .
n
, .vcw. ,
, . .

4.2 ()
8. File4New. Projects
WCE Pocket PC 2002 Application
9. Project Name SecPrApp,
Add to current workspace.

eMbedded Visual C++ 3.0

133

10. OK. .
A Simple Windows CE application Finish.
.
11. FileView Workspace.
, Workspace 'MyWsp' .
, , . ,
,
.



,
, FileView .
, .
Workspace
n Add New Project to Workspace
.
n Insert Project into Workspace .
.
Project
n Build , .
n Build (selection only) ,
. .
n Clean (selection only) .
n New Folder . .
.
n Add Files to Project . .
n Set Active Project . FileView
, Build .
n Settings .
n Properties
.

n New Folder .
.

134

4. Pocket PC Visual C++ 3.0

n Add Files to Folders


. , .
n Settings Project Settings, .
n Properties .

n Open .
n Compile .
n Settings Project Settings, .
n Properties , .


,
,
.


. Shift.
,
(Selection Margin). - .
. , , Ctrl+Shift+8.
, . . ,
Esc.


(Ctrl+C), (Ctrl+X) (Ctrl+V). Del . (Ctrl+Z)
(Ctrl+Y). ,
Edit.

eMbedded Visual C++ 3.0

135

, Edit , .
n Find .
n Find in Files .
n Replace .
n Go To .
.
q Adress
.
q Bookmark .
q Definition .
, .
q Reference .
, .

Reference Definition , Project4Settings4C\C++4Generate Browse Info, Project4Settings4Link4


Generate Debug Info Project4Settings4Browse Info4Built Browse Info File.

q Error/Tag . , .
q Line .
q Offset , .
n Bookmarks , . .
n Incremental Search . . , Find.
q Format Selection .
q Tabify Selection , .
q UnTabify Selection ,
.
q Make Selection Uppercase
.

136

n
n

n
n
n

4. Pocket PC Visual C++ 3.0

q Make Selection Lowercase


.
q View Witespace
.
Breakpoints , .
List Members , , .
Type Info ,
.
Parameter Info .
Complete Word .


, Edit, . . ,
, .
n Insert File Into Project
. , ,
.
n Open Document , .
n Insert/Remove Breakpoint
.
n Enable/Disable Breakpoint ,
.
n ClassWizard ,
MFC.


. . 4.4 .
4.4.

Ctrl+F

F3

Shift+F3

Ctrl+F3

eMbedded Visual C++ 3.0

Ctrl+ Shift+F3

F2

Shift+F2

Ctrl+F2

F12

Shift+F12

Ctrl+Num+

Ctrl+Num-

Ctrl+]

Ctrl+Shift+]

Alt+Shift+T

Ctrl+I

Ctrl+Shift+I

137

C

Delphi Visual Basic
eVC, , Visual?
, , eVB,
. .
, .
.

, . .

4.3
1. (File4New4Projects4WCE Pocket PC 2002 Application)
Buttons. .
A typical "Hello Word" application Finish.
2. Buttons.cpp, Ctrl+F
, case WM_CREATE ,
. , 4.13.
4.13
case WM_CREATE:
g_hwndCB = CreateRpCommandBar(hWnd);
memset (&s_sai, 0, sizeof (s_sai));
s_sai.cbSize = sizeof (s_sai);
break;

138

4. Pocket PC Visual C++ 3.0

3. .
. , . ,
4.14.
4.14
case WM_CREATE:
g_hwndCB = CreateRpCommandBar(hWnd);
memset (&s_sai, 0, sizeof (s_sai));
s_sai.cbSize = sizeof (s_sai);
CreateWindow(TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | BS_NOTIFY | WS_VISIBLE | WS_CHILD,
10, 20, 100,25, hWnd, (HMENU)200, g_hInst, NULL);
CreateWindow(TEXT ("BUTTON"), TEXT ("CheckBox"),
BS_CHECKBOX | WS_VISIBLE | WS_CHILD,
10, 50, 100,25, hWnd, (HMENU)201, g_hInst, NULL);
CreateWindow(TEXT ("BUTTON"), TEXT ("AutoCheck"),
BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD,
10, 80, 100, 25, hWnd, (HMENU)202, g_hInst, NULL);
CreateWindow(TEXT ("BUTTON"), TEXT ("AutoChec_3State"),
BS_AUTO3STATE | WS_VISIBLE | WS_CHILD,
10, 110, 100, 25, hWnd, (HMENU)203, g_hInst, NULL);
CreateWindow(TEXT ("BUTTON"), TEXT ("RadioButton1"),
BS_AUTORADIOBUTTON | WS_VISIBLE | WS_CHILD,
10, 140, 100, 25, hWnd, (HMENU)204, g_hInst, NULL);
CreateWindow(TEXT ("BUTTON"), TEXT ("RadioButton2"),
BS_AUTORADIOBUTTON | WS_VISIBLE | WS_CHILD,
10, 170, 100, 25, hWnd, (HMENU)205, g_hInst, NULL);
CreateWindow(TEXT ("BUTTON"), TEXT ("OwnerDrawButton"),
BS_PUSHBUTTON | BS_OWNERDRAW | WS_VISIBLE | WS_CHILD,
10, 200, 100, 25, hWnd, (HMENU)206, g_hInst, NULL);
CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | BS_NOTIFY | WS_VISIBLE | WS_CHILD,
125, 20, 100,25, hWnd, (HMENU)207, g_hInst, NULL);
CreateWindowEx(WS_EX_WINDOWEDGE, TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD,
125, 50, 100,25, hWnd, (HMENU)208, g_hInst, NULL);
CreateWindowEx(WS_EX_STATICEDGE, TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD,
125, 80, 100, 25, hWnd, (HMENU)209, g_hInst, NULL);
CreateWindowEx(WS_EX_TOOLWINDOW, TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD ,
125, 110, 100, 25, hWnd, (HMENU)210, g_hInst, NULL);
CreateWindowEx(WS_EX_CLIENTEDGE, TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_BORDER,
125, 140, 100, 25, hWnd, (HMENU)211, g_hInst, NULL);
CreateWindowEx(WS_EX_CLIENTEDGE, TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_CAPTION,
125, 170, 100, 25, hWnd, (HMENU)212, g_hInst, NULL);
CreateWindowEx(WS_EX_CLIENTEDGE, TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_OVERLAPPED,
125, 200, 100, 25, hWnd, (HMENU)213, g_hInst, NULL);
break;

4. , ,
4.15.

eMbedded Visual C++ 3.0

139

4.15
case WM_PAINT:
RECT rt;
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rt);
FillRect(hdc, &rt, CreateSolidBrush(0xFFFF00));
//LoadString(g_hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
//DrawText(hdc, szHello, _tcslen(szHello), &rt,
//DT_SINGLELINE | DT_VCENTER | DT_CENTER);
EndPaint(hWnd, &ps);
break;

.
, .
, Hello, Word!.
FillRect Magenta.
. . 4.5.

. 4.5. Buttons

,
.
5. , , , ,
CreateWindow. CreateWindowEx.

,
Windows (, , . .)
Windws. WM_COMMAND, CreateWindow, ,
.
Windows Control.

140

4. Pocket PC Visual C++ 3.0

CreateWindow CreateWindowEx
CreateWindow .
HWND CreateWindow(
LPCTSTR lpClassName,
LPCTSTR lpWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent,
HMENU hMenu,
HANDLE hInstance,
PVOID lpParam );

.
n lpClassName
.
q BUTTON , , .
q EDIT ,
.
q LISTBOX ,
.
q COMBOBOX EDIT LISTBOX. ,
.
q SCROLLBAR .
q Image , .
n lpWindowName ,
.
n dwStyle , .
.
q WS_BORDER .
q WS_CAPTION (
WS_BORDER).
q WS_CHILD . WS_POPUP.
q WS_CLIPCHILDREN
, .
q WS_CLIPSIBLINGS
. , .

eMbedded Visual C++ 3.0

141

q WS_DISABLED .
q WS_DLGFRAME ,
. .
q WS_GROUP .
, ,
, WS_GROUP.
WS_TABSTOP, .
q WS_HSCROLL .
q WS_OVERLAPPED .
q WS_POPUP .
WS_CHILD.
q WS_SYSMENU .
q WS_TABSTOP ,
TAB.
q WS_VISIBLE .
q WS_VSCROLL .
n x .
n y
.
n nWidth .
n nHeight .
n hWndParent .
n hMenu, , , ( WS_OVERLAPPED WS_POPUP), ( WS_CHILD).
n hInstance , .
n lpParam . Windows control NULL.
CreateWindowEx CreateWindow, ,
dwExStyle ,
.
n WS_EX_ACCEPTFILES ,
.
n WS_EX_APPWINDOW , .
n WS_EX_CLIENTEDGE .

142

4. Pocket PC Visual C++ 3.0

n WS_EX_DLGMODALFRAME .
, dwStyle.
n WS_EX_LEFT .
.
n WS_EX_LEFTSCROLLBAR .
.
n WS_EX_LTRREADING .
n WS_EX_MDICHILD MDI.
n WS_EX_NOACTIVATE , , .
n WS_EX_NOANIMATION ,
.
n WS_EX_NOPARENTNOTIFY , WM_
PARENTNOTIFY.
n WS_EX_OVERLAPPEDWINDOW ,
WS_EX_CLIENTEDGE WS_EX_WINDOWEDGE.
n WS_EX_PALETTEWINDOW ,
WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW WS_EX_TOPMOST.
n WS_EX_RIGHT .
n WS_EX_RIGHTSCROLLBAR ,
.
n WS_EX_RTLREADING
. .
n WS_EX_STATICEDGE . , .
n WS_EX_TOOLWINDOW ,
.
n WS_EX_TOPMOST ,
.
n WS_EX_TRANSPARENT ,
, .
n WS_EX_WINDOWEDGE .
, CreateWindow CreateWindowEx , , .
. , BS_PUSHBUTTON
WS_HSCROLL ,
?

eMbedded Visual C++ 3.0

143

Window Control
Window Control, , lpClassName,
, . dwStyle, .
BUTTON
BUTTON , , . .
n BS_BOTTOM .
n BS_CENTER .
n BS_DEFPUSHBUTTON ,
. ENTER,
, .
n BS_LEFT .
n BS_NOTIFY BN_KILLFOCUS BN_SETFOCUS. BN_CLICKED.
n BS_OWNERDRAW ,
. WM_
MEASUREITEM WM_DRAWITEM .
n BS_PUSHBUTTON , WM_COMMAND
.
n BS_RIGHT .
n BS_TOP .
n BS_VCENTER .
.
n BS_3STATE ,
. .
n BS_AUTO3STATE . , . .
n BS_AUTOCHECKBOX ,
.
n BS_CHECKBOX , .
n BS_LEFT .
n BS_PUSHLIKE ,
.
n BS_RIGHT .
n BS_RIGHTBUTTON .
.
n BS_AUTORADIOBUTTON , .

144
n
n
n
n

4. Pocket PC Visual C++ 3.0

BS_LEFT .
BS_RADIOBUTTON .
BS_RIGHT .
BS_RIGHTBUTTON ,
.

4.3 ()
6. , , ,
.
CreateWindowEx :
CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, TEXT ("BUTTON"), TEXT ("Button"), BS_GROUPBOX |
WS_VISIBLE | WS_CHILD, 2, 2, 235, 262, hWnd, (HMENU)213, g_hInst, NULL);

, ,
.
7. ,
, :
CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, TEXT ("BUTTON"), TEXT ("Button"), BS_GROUPBOX |
WS_VISIBLE | WS_CHILD | WS_OVERLAPPED, 2, 2, 235, 262, hWnd, (HMENU)213, g_hInst,
NULL);


, . , BS_GROUPBOX , .
EDIT
, .
n ES_AUTOHSCROLL
, .
ENTER .
n ES_AUTOVSCROLL , ENTER.
n ES_CENTER
.
n ES_LEFT .
n ES_LOWERCASE ,
.
n ES_MULTILINE . EDIT .
, ENTER, EDIT ,
ES_WANTRETURN. -

eMbedded Visual C++ 3.0

145

ES_AUTOVSCROLL, ,
. ES_AUTOVSCROLL ,
,
. ES_AUTOHSCROLL,

. ES_AUTOHSCROLL
. ENTER .

. ,
SCROLLBAR , , .

n ES_NOHIDESEL , .
n ES_NUMBER , .
n ES_OEMCONVERT , Windows CE OEM . ,
.
n ES_PASSWORD ,
.
n ES_READONLY .
n ES_RIGHT .
n ES_UPPERCASE
.
n ES_WANTRETURN
ENTER.
LISTBOX
,
.
n LBS_DISABLENOSCROLL . ,
, , .
n LBS_EXTENDEDSEL SHIFT.
n LBS_MULTICOLUMN ,
.
n LBS_MULTIPLESEL .
n LBS_NOINTEGRALHEIGHT ,
.

146

4. Pocket PC Visual C++ 3.0

n LBS_NOREDRAW
.
n LBS_NOSEL .
n LBS_NOTIFY ,
.
n LBS_SORT .
n LBS_STANDARD . , .
n LBS_USETABSTOPS .
n LBS_WANTKEYBOARDINPUT ,
, WM_VKEYTOITEM, .
COMBOBOX
COMBOBOX , . .
n CBS_AUTOHSCROLL .
n CBS_DISABLENOSCROLL .
n CBS_DROPDOWN
, .
n CBS_DROPDOWNLIST , .
n CBS_LOWERCASE
.
n CBS_NOINTEGRALHEIGHT .
n CBS_OEMCONVERT Windows CE OEM .
n CBS_SORT , .
n CBS_UPPERCASE .
SCROLLBAR
. .
n SB_HORZ .
n SB_VERT .

eMbedded Visual C++ 3.0

147

STATIC
. .
n SS_BITMAP , . . .
n SS_CENTER , . , , .
n SS_CENTERIMAGE , . , , ,
. , , .
n SS_ICON , ,
.
n SS_LEFT , .
n SS_LEFTNOWORDWRAP , ,
. .
n SS_NOPREFIX (&) .
n SS_NOTIFY ,
, .
n SS_RIGHT , .
Event-Driven Programming Window Messages
Windows Windows.
Windows, Windows CE. , .
. , ,
- , , .
,
, . , , . , . Windows Event-Driven Programming (
).
Windows , , .

148

4. Pocket PC Visual C++ 3.0

,
.

4.3 ()
, . . , , .
.
WinMain // Main message loop:.
. WndProc
switch. (, WM_COMMAND) . , ( hMenu). case switch
, .
, SendMessage. ,
. , ,
,
.
8. , , , // Global Variables: , :
HWNDg_hwndB1;

9. . , .
g_hwndB1=CreateWindow(TEXT ("BUTTON"), TEXT ("Button"),
BS_PUSHBUTTON | BS_NOTIFY | WS_VISIBLE | WS_CHILD,
10, 20, 100,25, hWnd, (HMENU)200, g_hInst, NULL);

10. .
, ,
. hMenu 207, ,
switch.
WndProc case WM_COMMAND: (
, ) , 4.16.
4.16
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
switch (wmId)
{

eMbedded Visual C++ 3.0

149

//
case 200:
SendMessage (g_hwndB1, WM_SETTEXT, 0, (LPARAM)(LPSTR)L"Svoy text");
break;
case 207:
SendMessage (g_hwndB1, WM_SETTEXT, 0, (LPARAM)(LPSTR)L"Text ot 107");
break;
case 208:
MessageBox (hWnd, L" !", L" ", 0);
break;
//
case IDM_HELP_ABOUT:
DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDOK:
SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE,0), (LPARAM)hWnd);
SendMessage (hWnd, WM_CLOSE, 0, 0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);

11. . case 200



WM_SETTEXT (g_hwndB1).
12. case 207
.
13. case 208
.

MessageBox.
,
. ,
, . .
n MB_OK OK .
n MB_OKCANCEL OK Cancel.
n MB_ABORTRETRYIGNORE Abort, Retry Ignore.
n MB_YESNOCANCEL Yes, No Cancel.
n MB_YESNO Yes No.
n MB_RETRYCANCEL Retry Cancel.
, , .
n MB_ICONHAND .
n MB_ICONQUESTION .
n MB_ICONEXCLAMATION .
n MB_ICONASTERISK I.

150

4. Pocket PC Visual C++ 3.0

. ,

,
:
MB_YESNOCANCEL | MB_ICONQUESTION

MessageBox int, , . , Yes,


No Cancel, No, 2.
.

4.3 ()
14. 208, 4.17.
4.17.
case 208:
msgResult = MessageBox (hWnd, L" !",
L" ", MB_OKCANCEL|MB_ICONQUESTION);
if (msgResult==1)
SendMessage (g_hwndB1, WM_SETTEXT, 0, (LPARAM)(LPSTR)L"!!!");
if(msgResult==2)
SendMessage (g_hwndB1, WM_SETTEXT, 0, (LPARAM)(LPSTR)L"!!!");
break;

15. WndProc
msgResult.
16. . OK Cancel, .
OK 200 !!!, Cancel
!!!.
17. ,
.
WndProc.
wchar_t *szStr;

18. ,
.
HWNDg_hwndB1, g_hwndB2;

19. 207, 4.18.


4.18
case 207:
msgResult=SendMessage (g_hwndB2, BM_GETCHECK, 0, 0);
switch (msgResult)
{
case 0: szStr = L"UnChecked";
break;
case 1: szStr = L"Checked";
break;
case 2: szStr = L"GrayChecked";

eMbedded Visual C++ 3.0

151

break;
}
SendMessage (g_hwndB1, WM_SETTEXT, 0, (LPARAM)(LPSTR)szStr);
break;

20. SendMessage , .
BM_GETCHECK.
,
.
21. . , AutoCheck_3State.
EDIT, LISTBOX COMBOBOX
,
ComboBox, , Edit ListBox. .

4.4
1. (File4New4Projects4WCE Pocket PC 2002 Application)
CombEdLi. A typical "Hello Word" application, Finish.
2. LoadString DrawText,
.
3. Global Variables :
HWNDg_hwndComB, g_hwndLnEd, g_hwndPass, g_hwndList, g_hwndMlnEd;
HWNDg_hwndBtn1, g_hwndBtn2, g_hwndBtn3;

, .
4. WndProc, , , , 4.19.
4.19
int i;
wchar_t *mstr[]={L"Elly", L"Totoshka", L"Strashila", L"Bastinda", L"Gingema", L"Elly",
L"Totoshka", L"Strashila", L"Bastinda", L"Gingema", L"Elly", L"Totoshka",
L"Strashila", L"Bastinda", L"Gingema"};
wchar_t tmp[128];

5. , , Parse the menu


selections, , 4.20.
4.20
switch (wmId)
{
// :
case 200:
if(wmEvent == CBN_SELCHANGE)

152

4. Pocket PC Visual C++ 3.0

{
SendMessage (g_hwndComB, CB_SETCURSEL, SendMessage (g_hwndComB,
CB_GETCURSEL, 0, 0), 0);
SendMessage (g_hwndComB, WM_COPY, 0, 0);
SendMessage (g_hwndMlnEd, WM_PASTE, 0, 0);
SendMessage (g_hwndMlnEd, EM_REPLACESEL, 0, (LPARAM)(LPCSTR)L"\r\n");
}
break;
case 201:
if (wmEvent == LBN_DBLCLK)
{
SendMessage (g_hwndList, LB_GETTEXT, SendMessage (g_hwndList,
LB_GETCURSEL , 0, 0), (LPARAM)(LPCTSTR)tmp);
SendMessage (g_hwndComB, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)tmp);
}
break;
case 205:
SendMessage (g_hwndPass, WM_GETTEXT, 20, (LPARAM)tmp);
SendMessage (g_hwndComB, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)tmp);
break;
case 206:
SendMessage (g_hwndLnEd, WM_GETTEXT, 20, (LPARAM)tmp);
SendMessage (g_hwndList, LB_ADDSTRING, 0, (LPARAM)(LPCSTR)tmp);
break;
case 207:
SendMessage (g_hwndMlnEd, WM_SETTEXT, 0, (LPARAM)(LPCSTR)"");
break;

6. case WM_CREATE break


, 4.21.
4.21
// ComboBox. WS_NOTIFY
//
g_hwndComB = CreateWindowEx(WS_EX_CLIENTEDGE , TEXT("COMBOBOX"),
TEXT(""),WS_NOTIFY|CBS_AUTOHSCROLL|WS_VSCROLL |WS_BORDER |WS_VISIBLE |WS_CHILD, 10,
10, 95, 100, hWnd, (HMENU)200, g_hInst, NULL);
// ListBox.
g_hwndList = CreateWindowEx(WS_EX_DLGMODALFRAME, TEXT("LISTBOX "), TEXT(""),
LBS_NOTIFY|WS_VSCROLL |WS_BORDER| WS_VISIBLE |WS_CHILD, 135, 10, 95, 100, hWnd,
(HMENU)201, g_hInst, NULL);
//
// Windows Messages
for (i = 0; i<15; i++)
{
SendMessage (g_hwndList, LB_ADDSTRING, i+1, (LPARAM)mstr[i]);
};
// , ES_PASSWORD
//
g_hwndPass = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, TEXT("EDIT"), TEXT(""),ES_PASSWORD
|WS_VISIBLE |WS_CHILD, 10, 115, 95, 25, hWnd, (HMENU)202, g_hInst, NULL);
//
g_hwndLnEd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, TEXT("EDIT"), TEXT(""), WS_VISIBLE
|WS_CHILD, 135, 115, 95, 25, hWnd, (HMENU)203, g_hInst, NULL);
// //(ES_MULTILINE|
ES_AUTOVSCROLL|WS_VSCROLL)

eMbedded Visual C++ 3.0

153

g_hwndMlnEd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, TEXT("EDIT"), TEXT(""),


ES_NOHIDESEL| ES_MULTILINE|ES_AUTOVSCROLL|WS_VSCROLL |WS_VISIBLE |WS_CHILD, 10, 150,
220, 110, hWnd, (HMENU)204, g_hInst, NULL);
// ,
g_hwndBtn1 = CreateWindowEx(WS_EX_WINDOWEDGE , TEXT("BUTTON"), TEXT("1"),BS_PUSHBUTTON
|WS_VISIBLE |WS_CHILD, 110, 10, 20, 40, hWnd, (HMENU)205, g_hInst, NULL);
g_hwndBtn2 = CreateWindowEx(WS_EX_WINDOWEDGE, TEXT("BUTTON"), TEXT("2"),BS_PUSHBUTTON
|WS_VISIBLE |WS_CHILD, 110, 55, 20, 40, hWnd, (HMENU)206, g_hInst, NULL);
g_hwndBtn3 = CreateWindowEx(WS_EX_WINDOWEDGE, TEXT("BUTTON"), TEXT("3"),BS_PUSHBUTTON
|WS_VISIBLE |WS_CHILD, 110, 100, 20, 40, hWnd, (HMENU)207, g_hInst, NULL);

7. . . 4.6.

. 4.6. CombEdLi

8. ListBox ComboBox. ComboBox


,
. ,
, 1
ComboBox . , , ListBox 2.
, ,
Ctrl+X, Ctrl+C Ctrl+V.
9. , WM_COMMAND. case ,
.
wParam, wmId.
WM_COMMAND , . ListBox ComboBox . WM_
COMMAND . wParam,
wmEvent.

154

4. Pocket PC Visual C++ 3.0

10. case 200 .


CB_SETCURSEL,

CB_GETCURSEL. , ComboBox , , .
. , , Edit, ComboBox, WM_COPY, WM_PASTE WM_CUT,
.
EM_REPLACESEL . ,
, . \r\n.
, .
11. case 201 , ListBox (wmEvent == LBN_DBLCLK).
tmp , ListBox, ComboBox.
12. case 205 case 206 ,
ListBox ComboBox.
13.
Edit, ListBox ComboBox. , ,
.
SCROLLBAR STATIC
.
SCROLLBAR
.
SCROLLBAR ,
, .
n WM_HSCROLL WM_HSCROLL .
n SBM_GETSCROLLINFO SBM_SETSCROLLINFO
.
API SetScrollInfo GetScrollInfo, , .
STATIC , . , .

eMbedded Visual C++ 3.0

155

Common Controls,

,
About.
, . ,
, .

4.5
1. Menu.
2. Workspace ResourceView,
Menu resources Menubar.
IDM_MENU.
(. 4.7).

. 4.7.

3. (Tools),
. ,
.
(. 4.8).

. 4.8.

156

4. Pocket PC Visual C++ 3.0

4. Tools
General4Separator.
.
5. .
Caption File. Pop-up, Autosize No wrap.
6. .
Caption File1.
7. .
Caption File2, Break Bar.
8. Separator.
9. .
Caption File3.
Checked.
10. ,
. 4.9.

. 4.9. File

11. .
Caption Edit.
Pop-up, Autosize No wrap.
12. .
Caption Ed1. Pop-up.
13. .
Caption Ed2.
14. Separator.
15. .
Caption Ed3.
16. Ed1, ,
Caption E1.
17. .
Caption E2, Break Column.
Checked.
18. .
Caption E3. Checked.
19. . 4.10 .

eMbedded Visual C++ 3.0

157

. 4.10. Edit

20. Separator.
21. CheckButton, Group, Autosize, No wrap, Pressed Bitmap.
Bitmap Index .
22. CheckButton, Group, Autosize, No wrap Bitmap. Bitmap Index
1.
23. Separator.
24. .
Caption UnGroup.
CheckButton, Autosize, No wrap Pressed.
25. , . 4.11.

. 4.11.

26. - . ,
. Break
. , . Break ,
.
27. Resource
View Insert.
Bitmap New. Bitmap, IDB_
BITMAP1. ,
.
. .
. 3216, , 1616.

158

4. Pocket PC Visual C++ 3.0

, . 4.12.

. 4.12.

28. . File View menu.cpp.


CreateRpCommandBar, , 4.22.
4.22
mbi.nBmpId = 0;
mbi.cBmpImages = 0;
:
mbi.nBmpId = IDB_BITMAP1;
mbi.cBmpImages = 2;

, .
29.
. , File2.
ID_FILE_FILE2.
, Resource View . WndProc .
HMENU hMenu = NULL;
MENUITEMINFO lpmii;

(hMenu) , (lpmii). WM_COMMAND switch (wmId) , 4.23.


4.23
// File2
case ID_FILE_FILE2:
//
// SHCMBM_GETSUBMENU (g_hwndCB)
// ,
// (ID_FILE)
hMenu = (HMENU)SendMessage(g_hwndCB, SHCMBM_GETSUBMENU, 0, ID_FILE);
// hMenu,
// lpmii:
GetMenuItemInfo(hMenu, ID_FILE_FILE2, false, &lpmii);
// fState lpmii (
// :

eMbedded Visual C++ 3.0

159

if (lpmii.fState == 0)
// UnChecked,
CheckMenuItem(hMenu, ID_FILE_FILE2, MF_BYCOMMAND|MF_CHECKED);
else
// Checked,
CheckMenuItem(hMenu, ID_FILE_FILE2, MF_BYCOMMAND|MF_UNCHECKED);
break;

30.
. ,
g_hwndCB.
HMENUg_hmPopup;

31. WM_CREATE
,
4.24.
4.24
g_hmPopup = CreatePopupMenu();
AppendMenu(g_hmPopup,MF_STRING, 1000,TEXT("pop 1"));
AppendMenu(g_hmPopup,MF_STRING, 1001, TEXT("pop 2"));
AppendMenu(g_hmPopup,MF_STRING, 1002,TEXT("pop 3"));
AppendMenu(g_hmPopup,MF_STRING|MF_MENUBARBREAK, 1003, TEXT("pop 4"));
AppendMenu(g_hmPopup,MF_STRING|MF_CHECKED, 1004,TEXT("pop 5"));
AppendMenu(g_hmPopup,MF_STRING, 1005, TEXT("pop 6"));

32. , 4.25.
4.25
case WM_LBUTTONDOWN:
{
WORD xPos = LOWORD(lParam); // horizontal position of the cursor
WORD yPos = HIWORD(lParam); // vertical position of the cursor
if (g_hmPopup){
TrackPopupMenuEx(g_hmPopup,0, xPos, yPos, hWnd, NULL);
}
}
break;

33. . , ,
.

. , . General .
n ID ,
.
n Caption .
n Caption ID , .

160

4. Pocket PC Visual C++ 3.0

n Pop-Up ,
, .
Pop-up
, .
n Separator .
n Shared New New, .
n Prompt , , .
n Break . None ,
. Column ,
, Bar ,
, .
,
Styles.
n Check Button . ,
.
n Group .
, Check Button. .
n Auto Size .
n No wrap .
n Pressed .
Check Button.
n Grayed .
n Indeterminate , , .
n Hidden .
n Highlighted .
, , More Styles.
n Bitmap .
n Bitmap index ,
, .
. CommandBar.

CommandBar
, .

eMbedded Visual C++ 3.0

161

4.6
1. CommandBar.
2. Workspace ResourceView,
Menu resources Menubar.
, Tools, File
Edit. , , .
CommandBar.
3. , .
4. Dialogs
Insert Dialog. IDD_DIALOG1.
, . Controls
Combo Box .
5. , CommandBar.cpp , 4.26.
4.26
// , CommandBar Combo Box
HWNDg_hwndCombo, g_hwndMenu;
HMENUg_hmCB;
// :
static TBBUTTON b_but1, b_but2, b_but3;

6. WinProc , 4.27.
4.27
int i;
RECT *lprc;
wchar_t *mstr[]={L"1", L"2", L"3", L"4"};

7. WM_CREATE
, 4.28.
4.28
// CommandBar g_hwndCB
g_hwndCB = CommandBar_Create(g_hInst,hWnd, 500);
// CommandBar (CB)
CommandBar_AddBitmap(g_hwndCB, g_hInst,IDB_BITMAP1, 2, 16, 16);
//
// , CB
SendMessage (g_hwndCB, TB_SETSTYLE, 0, (LPARAM)(DWORD)CCS_BOTTOM);
// CB
CommandBar_InsertMenubar(g_hwndCB, g_hInst, IDM_MENU, 0);
// CB Combo Box
g_hwndCombo = CommandBar_InsertComboBox (g_hwndCB, g_hInst, 30,
WS_CHILD|WS_VISIBLE,IDC_COMBO1, 1);
// Combo Box

162

4. Pocket PC Visual C++ 3.0

for (i=0;i<4;i++)
SendMessage (g_hwndCombo, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)mstr[i]);
// , Combo Box
SendMessage (g_hwndCombo, CB_SETCURSEL, (WPARAM)0, 0);
// ,
// CB
b_but1.iBitmap = 0;
b_but1.idCommand = 201;
b_but1.fsState = TBSTATE_ENABLED;
//
b_but1.fsStyle =TBSTYLE_BUTTON | TBSTYLE_DROPDOWN;
b_but1.dwData = 0;
b_but1.iString = -1;
CommandBar_InsertButton (g_hwndCB, 2, &b_but1);
//
g_hmCB = CreatePopupMenu();
AppendMenu(g_hmCB ,MF_STRING, 1000,TEXT("AI1"));
AppendMenu(g_hmCB,MF_STRING, 1001, TEXT(" AI2"));
//
b_but2.iBitmap = 1;
b_but2.idCommand = 202;
b_but2.fsState = TBSTATE_ENABLED;
b_but2.fsStyle = TBSTYLE_BUTTON|TBSTYLE_CHECKGROUP;
b_but2.dwData = 0;
b_but2.iString = -1;
CommandBar_InsertButton (g_hwndCB, 3, &b_but2);
b_but3.iBitmap = 0;
b_but3.idCommand = 203;
b_but3.fsState = TBSTATE_ENABLED;
b_but3.fsStyle = TBSTYLE_BUTTON|TBSTYLE_CHECKGROUP;
b_but3.dwData = 0;
b_but3.iString = -1;
CommandBar_InsertButton (g_hwndCB, 4, &b_but3);
break;

8. . , .
,
WM_COMMAND, .
, ?
,
TBN_DROPDOWN lParam WM_NOTIFY, , , . lParam LPTBNOTIFY, hdr,
code, . , - . , WinProc, 4.29.
4.29
case WM_NOTIFY:
//
if (((LPTBNOTIFY) lParam)->hdr.code == TBN_DROPDOWN)
{
// , lprc
SendMessage (g_hwndCB, TB_GETRECT, ((LPTBNOTIFY) lParam)->iItem, (LPARAM)(LPRECT)lprc);
// , , CB
i=CommandBar_Height(g_hwndCB);

eMbedded Visual C++ 3.0

163

// ,
// (
// TPM_RIGHTALIGN|TPM_BOTTOMALIGN
TrackPopupMenuEx(g_hmCB,TPM_RIGHTALIGN|TPM_BOTTOMALIGN, lprc->right, i, hWnd, NULL);
}
break;

9. .


.
, Combo Box Command Bar. , , ,
.
10. , .
11. Controls , . 4.13.

. 4.13. ,

12.
, .
13. ,
. ,
( DialogBox IDM_HELP_ABOUT), ( LRESULT CALLBACK About)
( OK
,

164

4. Pocket PC Visual C++ 3.0

EndDialog). .
14. ,
, . , ,
, SDK.
C:\Windows CE Tools\wce300\Pocket PC
2002\samples\win32.
, SDK, .
n CalendarAndDTP Calendar Date Time
Picker.
n Cmdbar CommandBar
.
n ComCtls ,
.
n DirTree Tree Control.
n Dynamenu .
n HandleSIP
.
n Keytest2 ,
.
n ListView ListView2 ListView
.
n ReBar ReBar ToolBar.
n Toolbar ToolBar.
n TrackStylus .

, ,
, ,
. , ,
, ,
.
, . ,
, ,
, . .
, , , . -

eMbedded Visual C++ 3.0

165

, , ,
, , .


, . . WCE configuration,
. 4.14.

. 4.14. WCE configuration

. , .
,
. ,
Build4Configurations4Add Project4Settings. ,
.

Pocket PC
WCE ARM, WCE x86. Pocket PC
ARM, Pocket PC. , Pocket PC.

, , . Win32 (WCEx86) Debug


Win32 (WCE ARM) Debug.
(breakpoints)
,
.
Insert\Remove Breakpoint , WCE Configuration. , , F9 . ,
, - . ,
, . 4.15.

166

4. Pocket PC Visual C++ 3.0

. 4.15. ,

. Debug. , .
n F11 . ,
.
n F10 . , , . .
n Shift+F11 . , , , ,
,
.
n Ctrl+F10
, .
, .

, ,
, ,
, . eVC Watches Variables.
Variables ,
(. 4.16).

. 4.16. Variables

eMbedded Visual C++ 3.0

167

.
, .
. Auto ,
. Locals , . This , , this.
n Auto , .
,
.
n Watches ( 4.17):

. 4.17. Watches

n ,
, Nme.

, QuickWatch
Add Watch.


n , Tools4Customize Tools4Options. Customize ,
Options.
(. 4.18).
n .
Editor
, Window settings, .
n Vertical scroll bar .
n Automatic window recycling .

168

4. Pocket PC Visual C++ 3.0

. 4.18. Options

n Drag-and-drop text editing


.
n Horizontal scroll bar .
n Selection margin .
, ,
Save Options. .
n Save before running tools , , .
n Automatic reload of externally modified files ,
.
n Prompt before saving files .
. Statement
complition options.
.
n Auto list members
.
, Ctrl+Alt+T.
n Auto type info . ,
Ctrl+T.
n Code comments
, .
n Auto parametr info
.

eMbedded Visual C++ 3.0

169

Tabs
.
n File Type , .
n Tab size Tab .
n Indent Size , .
n Indent Spaces\Kepp Tabs
.
Auto indent
.
n none .
n default .
n Smart , , , .
Smart indents options.
n Indent open brace .
n Indent closing brace .
n NN pevous lines using for context ,
.
Debug
.

.
n GUID display , GUID, , , GUID.
n View floating-point registers Register.
n Return value , , Variables.
n Load COFF & Exports COFF-
DLL.
,
, Disassembly window.
.
n Source annotation .
n Code bytes .
n Symbols
.
Call stack window.
Parameter values ,

170

4. Pocket PC Visual C++ 3.0

, Parameter types .
,
Memory window. .
n Adress .
n Format , .
n Re-evaluate expression Memory.
n Show data types
.
n Fixed width .
Compatibility
,
,
.
n Current source editor emulation , eVC.
n Options .
q Disable backspace at start of line
Backspace.
q Enable copy without selection , , .
q Enable line-mode pastes , .
q Enable virtual spaces
.
q Include caret position in undo buffer
.
q Indent separate paragraf , , .
q Protect read-only files from editing , .
q Use BRIEF's regular expression syntax BRIEF.
q Double-click in dialod editor edit code (MFC only)
.
Download
.

.

eMbedded Visual C++ 3.0

171

n Always dounload binary to the target .


n Always dounload dependencies to the target .
n Connection timeout , .
Build
.
n Export makefile when saving project file Makefile.
n Always write dependencies when writing makefiles Makefile .
n Write Build Log .
Directories

.
n Platform , .
n CPUs , .
n Show directory for , .
n Directories .
,
.
Workspace
Workspace
.
n Docking view , . , .
n Display status bar .
n Display clock on status bar .
n Reload documents when opening workspace
, .
n Reload last workspace on startup , .
n Automatically sort window menu Windows.
n Use screen reader compatible menus , .

172

4. Pocket PC Visual C++ 3.0

n Show recently used items on submenu


.
n Window menu contains , Windows.
n Recent file list contains .
n Recent workspace list contains .
Macros
,
.
n Always reload the file .
n Never reload the file .
n Ask whether to reload the file .
Format
.
n Category , .
n Font .
n Size .
n Colors .
n Foreground .
n Background .

C++

C++ , .
, , .exe, .cpp .h. .cpp ,
.h . ,
. .
1. .
C++. , , , .
,

C++

173

, ,
.
,
.
2. . , .
3. . .exe.
, ,
, ,
. ++ make. make
(makefile), , , , . eVC
. Build Execute Build,
. ,
.vcp.



, ,
, .
,
.
, ( #include).
.
? ,
,
#include.
.
1. , .
2. .
3. .
4. .
5. , .

174

4. Pocket PC Visual C++ 3.0

.
? .

4.7
1. AdvancedCPP.
2. FileView newres.h
.
, .
#include
, . newres.h #include.
#include <commctrl.h>

,
newres.h commctrl.h,
. newres.h, ,
.
#define ,
.
3. :
#define AFXCE_IDR_SCRATCH_SHMENU 28700

AFXCE_IDR_SCRATCH_SHMENU 28700. , AFXCE_


IDR_SCRATCH_SHMENU, 28700.
4. FileView aygshell.h. :
#define CEM_UPCASEALLWORDS (WM_USER + 1)

, , CEM_UPCASEALLWORDS, (WM_USER + 1).


, , .
, #define MF(a, b, c) (a*b*c/(a+b+c)) MF(x, y, z).
, (x*y*z/(x+y+z)).
newres.h :
#ifndef __NEWRES_H__
#define __NEWRES_H__

:
#endif //__NEWRES_H__

#define.
#define __NEWRES_H__
__NEWRES_H__ .

C++

175

. , #define ,
, ,
.
( ). #if, #ifdef, #ifndef, #endif,
#else #elif.
#if . const_exp, #if #if const_exp, , , #if #endif, ,
( , ).
.
ident, #ifdef #if ident, , , #ifdef #endif, ,
.
ident, #ifndef #ifndef ident,
, , #ifndef
#endif, ,
.
,
4.30.
4.30
#if cnst_ex1// const_exp1 true,
[text1]// text1
[#elif cnst_ex2// cnst_ex2 true,
text2]// text2
[#elif cnst_ex3// cnst_ex3 true,
text3]// text3 .

[#elif cnst_exN// ,
textN]// textN
#endif//

, 4.31.
4.31
/* __NEWRES_H__ , */
#ifndef __NEWRES_H__
/* */
#define __NEWRES_H__
[ ]
#endif //__NEWRES_H__

__NEWRES_H__ - , .

176

4. Pocket PC Visual C++ 3.0

, #include.
,
. , #include.
#undef ,
#define.
#line
, __LINE__ __FILE__.
#import . ,
#import ..\office\office.olb

office.olb .
#pragma , . #pragma.

main() WinMain()
C++ . , ,
. , ++, . main(), Windwos
WinMain(). , , .

main(),
main() , , .
Windows .
WinMain(), . , WM_QUIT, ,
.
WinMain .
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int nShowCmd );

.
n hInstance .

C++

177

n hPrevInstance . Pocket PC NULL.


n lpCmdLine , , .
,
.
n nShowCmd , ,
. . 4.5.
4.5.

SW_HIDE

SW_SHOW

SW_SHOWNA
SW_SHOWNOACTIVATE

SW_SHOWNORMAL

WinMain() , wParam WM_QUIT.



C++ , ,
, .
, ,
.
eVC
, , .

4.7 ()
5. advance.cpp . ,
WndProc, IDM_HELP_ABOUT
, .
MessageBox(hWnd, MyFunk1(), TEXT("MAMA "), 0);

, MyFunk1().
6. WndProc MyFunk1,
4.32.
4.32
LPCTSTR MyFunk1(){
return (LPCTSTR)TEXT("MUMU");
}

178

4. Pocket PC Visual C++ 3.0

7. . , , MyFunk1 .
, , - ,
. WndProc, WndProc :
LPCTSTR MyFunk1();

8. MyFunk1 . ,
Tools4About MUMU.
9. , , .
(File4New4Files4C++ Source File)
mod1.cpp. (File4New4
Files4C\C++ Header File) mod1.h.
10. mod1.h , 4.33.
4.33
#ifndef __MOD1_H__
#define __MOD1_H__
LPCTSTR MyFunk2(int x, LPCTSTR y);
#endif //__MOD1_H__

, . ,
.
.
11. mod1.cpp , 4.34.
4.34
#include "stdafx.h"
#include "mod1.h"
#include <string.h>
wchar_t strA[512];
wchar_t strB[5];
wchar_t *str1 = strA;
wchar_t *str2 = strB;
LPCTSTR MyFunk2(int x, LPCTSTR y){
str2 = wcscpy(str2, y);
for (int i = 0; i<x; i++){
wcscat(str1, str2);
wcscat(str1, TEXT(" "));
}
return LPCTSTR(str1);
};

179

12. advance.cpp, mod1.h, , 4.35.


4.35
#include "stdafx.h"
#include "advance.h"
#include "mod1.h"

13. , , . MyFunk1, 4.36.


4.36
LPCTSTR MyFunk1(){
return (LPCTSTR)MyFunk2(25, (LPCTSTR)TEXT("MUMU"));
}

14. MUMU 25 .
extern static
, , extern. LPCTSTR MyFunk1()
extern LPCTSTR MyFunk1() . extern .
extern ,
.
.
static, , , .


eVB, Application Install
Wizard, eVC . Pocket PC SDK
, , eVC. C:\Windows CE Tools\wce300\Pocket PC 2002\
support\ActiveSync\windows ce application installation CabWiz.exe
.
, .
Pocket PC
.
n CAB Wizard , (CAB-) .
n Application Manager ActiveSync, Pocket
PC .

180

4. Pocket PC Visual C++ 3.0

n WCELoad , Pocket PC
, Pocket PC , .
n
(CAB Wizard), , Pocket PC (Application Manager) , , Pocket PC (WCELoad).
CAB Wizard .

.inf
Pocket PC Windows . , .
,
, .
[Version].
n Signature $Windows NT$ $Windows 95$.
n Provider , .
n CESignature $Windows CE$.
[CEStrings].
n AppName .
%AppName% inf- app_name.
n InstallDir . %InstallDir% inf- .
[Strings] . [CEDevice] .
n ProcessorType , SYSTEMINFO.
dwProcessorType.
n UnsupportedPlatforms .
n VersionMin ,
OSVERSIONINFO.dwVersionMinor.
n VersionMax ,
OSVERSIONINFO.dwVersionMajor.
[DefaultInstall]. ,
, . , ,

181

, inf-. .
n Copyfiles ( ). , .
n AddReg ( ). , , .
n CEShortcuts = , , .
n CESetupDLL , , .
n CESelfRegister , DllRegisterServer,

DllUnregisterServer.
[SourceDisksNames] . disk_id
. , .
[SourceDisksFiles] ,
. filename.
[DestinationDirs] , ,
[CopyFiles]. DefaultDestDir .
,
.
[CopyFiles] ,
CopyFiles [DefaultInstall].
destination_filename,[source_filename],[,flags],
destination_filename , source_filename , ( destination_
filename source_filename , ).
flags . 4.6.
[AddReg] ,
AddReg [DefaultInstall]. ,
.
registry_root_string, subkey, [value_name], flags, value [,value]. registry_
root_strings .
n HKCR HKEY_CLASSES_ROOT.
n HKCU HKEY_CURRENT_USER.
n HKLM HKEY_LOCAL_MACHINE.

182

4. Pocket PC Visual C++ 3.0

4.6.

COPYFLG_WARN_IF_SKIP

0x00000001

COPYFLG_NOSKIP

0x00000002

COPYFLG_NO_OVERWRITE

0x00000010

COPYFLG_REPLACEONLY

0x00000400

CE_COPYFLG_NO_DATE_DIALOG

0x20000000

CE_COPYFLG_NODATECHECK

0x40000000

CE_COPYFLG_SHARED

0x80000000

value_name .
flags , . 4.7.
4.7.

FLG_ADDREG_NOCLOBBER

0x00000002

FLG_ADDREG_TYPE_SZ

0x00000000

REG_SZ

FLG_ADDREG_TYPE_MULTI_SZ

0x00010000

REG_MULTI_SZ

FLG_ADDREG_TYPE_BINARY

0x00000001

REG_BINARY

FLG_ADDREG_TYPE_DWORD

0x00010001

REG_DWORD

[CEShortCuts] CEShortCuts [DefaultInstall].


:
shortcut_filename,shortcut_type_flag,target_file/path[,standard_destination_path]

. shortcut_filename ( .lnk). shortcut_type_flag


. , ,
, . target_file/path
, .

4.8
, 4.5.

183

1. ,
, , ,
, COM-, , . menu.exe, menu.ico, bitmap2.bmp
readme.txt. menu.exe, menu.ico bitmap2.bmp
\Storage Card\Menu\, readme.txt \My Documents\Menu\.
, . , .
\Windows\Start Menu\
Programs.
2. C:\setup. , . menu.exe \menu\ARMRel.
, , Win32 (WCE ARM) Relias.
C:\Windows CE Tools\wce300\Pocket PC 2002\support\ActiveSync\windows ce application installation. cabwiz buildcab.bat
register.bat.

3. buildcab.bat. .
"C:\Setup\cabwiz\CabWiz.exe" "C:\Setup\menu.inf" /err err.log

CabWiz.exe, menu.inf, err.log.


4. , ,
, menu.inf.
Setup , 4 . menu.inf .
4.37.
4.37
[Version]
Signature = "$Windows NT$"
Provider = "MyBestCompany"
CESignature = "$Windows CE$"
[CEStrings]
AppName = "Menu Sample"
InstallDir = %CE1%\Menu
[Strings]
reg_path = Software\MyBestCompany\Menu
[DefaultInstall]
Copyfiles = Files.Main, Files.Help
AddReg = RegSettings

184

4. Pocket PC Visual C++ 3.0

CEShortcuts = Shortcuts
[SourceDisksNames]
1 = ,"Menu files",,C:\setup\
[SourceDisksFiles]
menu.exe = 1
bitmap2.bmp = 1
menu.ico = 1
ReadMe.txt = 1
[DestinationDirs]
Files.Main
= 0, %InstallDir%
Files.Help
= 0, "My Documents"\Menu
Shortcuts = 0, %CE11%
[Files.Main]
menu.exe,,,0x00000001
menu.ico,,,0x00000001
bitmap2.bmp,,,0x00000001
[Files.Help]
ReadMe.txt,,,0x00000001
[RegSettings]
HKLM,%reg_path%,,0x00000000,alpha
HKLM,%reg_path%,test,0x00010001,3
[Shortcuts]
MenuApp,0,menu.exe, %CE11%

5. ,
Setup. CabWiz.exe . buildcab.bat.
Setup menu.CAB.
.
.
WCELoad. , .
Pocket PC, Application Manager
register.bat, , C:\Windows CE Tools\Htmlhelp\emtools\WCESETUP.CHM. Windows
CE Directory Identifiers %CEx%, .


Pocket PC Microsoft
eMbedded Visual ++ 4.0
VC 3.0 eVC 4.0,
, . eVC 4.0 , Pocket PC 2003. , , Pocket
PC 2002. eVC,
.

, , ,

(- ), .
.

. ,
,
. , . , , ,
, ,

186

5. Pocket PC Visual ++ 4.0

, . .
.

( ) ( ).
.
, .
. ,
. C++ , .

. , , .
. ,
- , , .

, , . .

,
, , .
,
.
, .
.
<classkey> <classname> <:baselist>] { <member list> }

<classkey> class, struct union. <classname> . <baselist>


, .
,
<baselist> . <member list> .

187

, ,
. , .
.
, ,
5.1.
5.1
class First {
int memi;
double memd;
};
class Second {
int memi;
double memd;
};
class First obj1;
Second obj2 = obj1;

// : obj1 obj2

.
.
,
.
, . class, . obj1 First
. .
obj2 Second.
.
C ,
C++ .

,
->.

5.1
1. WCE Pocket PC 2003 Application. OOP1. Typical "Hello Word" application.
2. Workspace
IDD_ABOUTBOX .
3. ,
, . 5.1.

188

5. Pocket PC Visual ++ 4.0

. 5.1.

4. .
,
Caption.
5. File4New,
C/C++ Header File, DogClass OK.
.
, 5.2.
5.2
class Dog {
public:
Dog();
~Dog();
wchar_t Name;
int age;
void Speak(){
char mm[32];
wchar_t *szStr = L"";
wchar_t mstr[32];
sprintf(mm," : %d\n", age);
strcat(mm," ");
mbstowcs(mstr, mm, 32);
szStr = mstr;
MessageBox(NULL, szStr, TEXT("TUT"), 0);
};
};
Dog::Dog(){
age = 12;
};
Dog::~Dog(){
};

6. , . OOP1.cpp
#include :
#include "DogClass.h"

189

7. , // Global Variables,
.
Dog

*MyDog;

8. , , 5.3.
5.3
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
SHINITDLGINFO shidi;
int wmId, wmEvent;
switch (message)
{
case WM_INITDIALOG:
// Create a Done button and size it.
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hDlg;
SHInitDialog(&shidi);
return TRUE;
case WM_COMMAND:
wmId
= LOWORD(wParam);
wmEvent = HIWORD(wParam);
switch (wmId)
{
case IDC_BUTTON1:
MyDog = new Dog();
break;
case IDC_BUTTON2:
delete MyDog;
MyDog = NULL;
break;
case IDC_BUTTON3:
MyDog->age = 200;
break;
case IDC_BUTTON4:
MyDog->Speak();
break;
}
if (LOWORD(wParam) == IDOK)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}

9. . Tools4
About .
Create, Call.

190

5. Pocket PC Visual ++ 4.0

12 . Assign, Call. 200 .

10. Destroy Call. . eVC


, F5. Assign .
Stop Debugging .
, .
Create Dog. , Dog
Dog(),
, , Dog, ,
MyDog.
-> MyDog.
Dog() .
. , . , , .
, .
. , ,
MyDog.
.
Assign Call Age Speak() MyDog. Destroy , .
. ~Dog(), .
,
.
Dog, Dog.
. ,
, , . ,
new .

(
),
. .

191


. .

5.1 ()
11. DogClass.h
CleverDog. ,
,
. 5.4.
5.4
class CleverDog: public Dog {
public:
void Add(int x, int y){
int i = x+y;
char mm[32];
wchar_t *szStr = L"";
wchar_t mstr[32];
sprintf(mm," : %d\n", i);
mbstowcs(mstr, mm, 32);
szStr = mstr;
MessageBox(NULL, szStr, TEXT("TUT"), 0);
};
void Mult(int x, int y){
int i = x*y;
char mm[32];
wchar_t *szStr = L"";
wchar_t mstr[32];
sprintf(mm," : %d\n", i);
mbstowcs(mstr, mm, 32);
szStr = mstr;
MessageBox(NULL, szStr, TEXT("TUT"), 0);
};
};

12. OOP1.cpp Dog *MyDog; CleverDog *MyDog;.


13. Create,
5.5.
5.5
case IDC_BUTTON1:
MyDog = new CleverDog();
break;

14. Create,
Assign, Call Destroy. , ,
CleverDog Age Speak(). Dog. :
class CleverDog: public Dog {

15. Call, 5.6.

192

5. Pocket PC Visual ++ 4.0

5.6
case IDC_BUTTON4:
MyDog->Speak();
MyDog->Add(10, 20);
MyDog->Mult(6, 7);
break;

16. . Create,
Assign, Call Destroy , .
CleverDog .
:
:
n Dog.
n CleverDog.
:
n CleverDog.
n Dog.

, , , ,
, ,
.


, . eVC.

5.1 ()
17. DogClass.h , 5.7. CleverDog, ,
.
5.7
class StupidDog: public Dog {
public:
void Add(int x, int y){
int i = x*y;
char mm[32];
wchar_t *szStr = L"";
wchar_t mstr[32];
sprintf(mm," : %d\n", i);
mbstowcs(mstr, mm, 32);

193

szStr = mstr;
MessageBox(NULL, szStr, TEXT("TUT"), 0);
};
void Mult(int x, int y){
int i = x+y;
char mm[32];
wchar_t *szStr = L"";
wchar_t mstr[32];
sprintf(mm," : %d\n", i);
mbstowcs(mstr, mm, 32);
szStr = mstr;
MessageBox(NULL, szStr, TEXT("TUT"), 0);
};
};

18. Dog , 5.8.


5.8
virtual void Add(int x, int y) = 0;
virtual void Mult(int x, int y) = 0;

19. OOP1.cpp CleverDog


Dog,
5.9.
5.9
// Global Variables:
HINSTANCE
g_hInst;
HWND
g_hwndCB;
Dog
*Dogs[4];

20. , 5.10.
5.10
int i;
case IDC_BUTTON1:
Dogs[0] = new CleverDog();
Dogs[1] = new StupidDog();
Dogs[2] = new CleverDog();
Dogs[3] = new StupidDog();
break;
case IDC_BUTTON2:
for(i = 0; i<4; i++) {
delete Dogs[i];
Dogs[i] = NULL;
}
break;
case IDC_BUTTON3:
Dogs[0]->age = 200;
break;
case IDC_BUTTON4:
for(i = 0; i<4; i++)
Dogs[i]->Mult(20, 10);
break;

194

5. Pocket PC Visual ++ 4.0

21. . Create, Call Destroy. Call


200
30.
CleverDog StupidDog . , , StupidDog .
C++ . CleverDog
StupidDog Dog. Dog
Add Mult, Dogs[i]->Mult() .
, Dog . , . ,
, , . , .
,
virtual (), . .


() ,
.
. , .
. private, protected, public
friend. .
private
, , . , private private- ,
( ) .
, , private, . . , private, ,
.
protected
, protected,
, private, .

195

, protected

, .
public
, ,
,
.
friend
,
.
, , ,
, , . , ,
. C++
- (friend)
. ,
. friend , private protected ,
, .

5.1 ()
22. Dog age public
private, 5.11.
5.11
class Dog {
private:
int age;
public:
Dog();

23. . 'age' : cannot access private member declared in class 'Dog'.


private ,
Assign .
24. age protected, 5.12.
5.12
class Dog {
protected:
int age;
public:
Dog();

196

5. Pocket PC Visual ++ 4.0

25. , , protected .
public, .
26. Add CleverDog, 5.13.
5.13
class CleverDog: public Dog {
void Add(int x, int y){
age= 200;
};

27. Assign, 5.14.


5.14
case IDC_BUTTON3:
Dogs[0]->Add(0,0);
break;

28. ,
Assign . Dog CleverDog, Add
age, protected .


.
, . .

5.1 ()
29. Dog Speak(),
5.15. Speak(), ,
.
5.15
void Speak(int x){
char mm[32];
wchar_t *szStr = L"";
wchar_t mstr[32];
sprintf(mm,", :
mbstowcs(mstr, mm, 32);
szStr = mstr;
MessageBox(NULL, szStr, TEXT("TUT"), 0);
};

%d", x);

30. Assign,
5.16.

197

5.16
case IDC_BUTTON3:
Dogs[0]->Speak();
Dogs[0]->Speak(350);
break;

. C++ . , , , , ,
,
.


C++ , C. ,
, .
,
, . .
byte x = 12;
float y = x;

.
.

. (). .
(const unsigned short *)szStr

++ .
++ .
const_cast. ,
const, , ,
const_cast. const
.
.
const_cast<type>(exp)

type , exp. , ,
int.
void my_func(int *x);

const int x, . my_func(&x) , . const_cast :


my_func(const_cast<int *>(&x));

198

5. Pocket PC Visual ++ 4.0

dynamic_cast . .
dynamic_cast<type*>(exp)

RTTI (
).
. , .
, .
reinterpret_cast .
.
reinterpret_cast<type>(exp)

(exp)
<type>. void* .
static_cast , .

MFC
- eVC, MFC (Microsoft Foundation Classes).
MFC ,
- ,
, . Windows, Microsoft , , .

, .
, MFC
. MFC,
, , , , MFC.
MFC Windows API. , MFC WinAPI MFC, .

MFC
, MFC, . ,
, ,
.

MFC

199

, MFC, Microsoft http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/


_mfc_Hierarchy_Chart.asp. msdn.microsoft.com,
Library, MFC, Microsoft Foundation Class Library
Hierarchy chart.
. MFC Windows API. MFC CObject,
, .
, , MFC Windows CE. Microsoft Foundation Class
Library for Windows CE .NET4Guide to MFC for Windows CE .NET4Unsupported MFC
Classes , Windows.
Windows CE , . Differences from Desktop MFC
, MFC.
MFC , . , .
CObject
CObject MFC.
MFC ,
CObject.
CObject ,
MFC. .
n MFC. , .
. , ,
. CObject IsSerializable() Serialize().
n Run-time class information ,
. GetRuntimeClass() IsKindOf(). .
n Object diagnostic output
Dump(), . . Dump()
.
AssertValid().
n CObList CObArray, CObject, , .

200

5. Pocket PC Visual ++ 4.0

,
MFC, .
CWinApp
MFC- ,
. CWinApp ,
. InitInstance()
, MFC . , eVC
, .
CView
, .
CView OnDraw().
CView. CView
. .
n CCtrlView document\view
CEditView, CListView CTreeView.
n CEditView .
Memo.
n CListView .
n CTreeView .
n CFormView ,
.
n CScrollView CView .
CDocument
.
CDocument . CView. CDocument .

n .
n CView, .
n .
n , ,
.
CView . CView .

MFC

201

CFrameWnd
. .
n .
n , .
n .
n drag-and-drop.
n .
CDocTemplate
CFrameWnd, CView
CDocument, ,
. CDocTemplate
, ,
.

MFC
MFC Pocket PC
File4New4Projects4WCE Pocket PC MFC AppWizard (exe). , OK.
(Step 1) .
Single Document with Doc List , (. 5.2).

. 5.2. , Single Document with Doc List

, (. 5.3), .

202

5. Pocket PC Visual ++ 4.0

. 5.3.

Single Document , , .
Dialog Based ,
(. 5.4). ,
.

. 5.4. , Dialog Based

Next
(Step 2).
.
n Windows Sockets ,
.

MFC

203

n ActiveX Controls , ActiveX.


n Shared New , ,
New.
n , , ,

Internet Explorer. . Basic MenuBar, .
Internet Explorers ReBars, , (. 5.5).

. 5.5.

. ,
, , Yes, please. , , No,
thank you. , MFC .
as a shared DLL. , as a staticaly linked library.
n , , ,
Finish.
n ,
, .
.

5.2
, .
1. WCE Pocket PC 2003 NotePad.
Single Document with Doc List
Finish.
2. . . , ,
. , .

204

5. Pocket PC Visual ++ 4.0

,
, .
.txt,
.
3. CNotePadView. , CEditView.
ClassView,
CNotePadView :
class CNotePadView : public CEditView

4. ClassView CNotePadView
PreCreateWindow(CREATESTRUCT& cs).
, 5.17.
5.17
BOOL CNotePadView::PreCreateWindow(CREATESTRUCT& cs)
{
if(!CEditView::PreCreateWindow(cs))
return FALSE;
cs.style &= ~WS_VSCROLL;
cs.style &= ~WS_HSCROLL;
cs.style &= ~ES_AUTOHSCROLL;
m_dwDefaultStyle &= ~WS_VSCROLL;
m_dwDefaultStyle &= ~WS_HSCROLL;
m_dwDefaultStyle &= ~ES_AUTOHSCROLL;
return TRUE;
}

5. , ,
.
, ,
.
, .
MFC .

. 5.6.

MFC

205

6. CNotePadView .
ClassView Add Member Function. .
, . 5.6.
5.18.
5.18
void CNotepadView::UpdateViewWindow()
{
CEdit& edit = GetEditCtrl();
TEXTMETRIC tm;
CDC* pDC = edit.GetDC();
pDC->GetTextMetrics(&tm);
edit.ReleaseDC(pDC);
CRect r;
edit.GetRect(&r);
int noOfVisibleLines = r.Height() / tm.tmHeight;
if(edit.GetLineCount() > noOfVisibleLines)
{
long lwStyle = ::GetWindowLong(edit.GetSafeHwnd(), GWL_STYLE);
if(!(lwStyle & WS_VSCROLL))
{
lwStyle |= WS_VSCROLL;
::SetWindowLong(edit.GetSafeHwnd(), GWL_STYLE, lwStyle);
}
int nCaretLine = edit.LineFromChar();
int nFirstVisible = edit.GetFirstVisibleLine();
if(nFirstVisible + noOfVisibleLines <= nCaretLine)
{
HideCaret();
edit.LineScroll(nCaretLine - nFirstVisible - noOfVisibleLines + 1);
ShowCaret();
}
if(nFirstVisible > nCaretLine)
{
HideCaret();
edit.LineScroll(nCaretLine - nFirstVisible);
ShowCaret();
}
}
else
{
long lwStyle = ::GetWindowLong(edit.GetSafeHwnd(), GWL_STYLE);
if(!(lwStyle & WS_VSCROLL))
return;
int nFirstVisible = edit.GetFirstVisibleLine();
edit.LineScroll(-nFirstVisible, 0);
lwStyle &= ~WS_VSCROLL;
::SetWindowLong(edit.GetSafeHwnd(), GWL_STYLE, lwStyle);
}
}

7. .
CNotePadView .

206

5. Pocket PC Visual ++ 4.0

CNotePadView ClassView
Add Virtual Function. (. 5.7).

. 5.7.

,
.
OnUpdate,
. New Virtual Functions
OnUpdate, Add
and Edit. , . , 5.19.
5.19
void CNotePadView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CEditView::OnUpdate(pSender, lHint, pHint);
UpdateViewWindow();
}

8. OnKeyDown.
CNotePadView ClassView.
OnKeyDown MFC Windows,
Add Windows
Message Handler. (. 5.8).
9. New Windows Messages/events WM_
KEYDOWN, OK. . , 5.20.
5.20
void CNotePadView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CEditView::OnKeyDown(nChar, nRepCnt, nFlags);

MFC

207

if(nChar == VK_DELETE)
{
CEdit& edit = GetEditCtrl();
TEXTMETRIC tm;
CDC* pDC = edit.GetDC();
pDC->GetTextMetrics(&tm);
edit.ReleaseDC(pDC);
CRect r;
edit.GetRect(&r);
int noOfVisibleLines = r.Height() / tm.tmHeight;
if(edit.GetLineCount() <= noOfVisibleLines)
{
long lwStyle = ::GetWindowLong(edit.GetSafeHwnd(), GWL_STYLE);
if(!(lwStyle & WS_VSCROLL))
return;
int nFirstVisible = edit.GetFirstVisibleLine();
edit.LineScroll(-nFirstVisible, 0);
lwStyle &= ~WS_VSCROLL;
::SetWindowLong(edit.GetSafeHwnd(), GWL_STYLE, lwStyle);
}
}
}

. 5.8. , Windows


.
10. , , ,
, , 8,
WM_CHAR ,
5.21.

208

5. Pocket PC Visual ++ 4.0

5.21
void CNotePadView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CEditView::OnChar(nChar, nRepCnt, nFlags);
UpdateViewWindow();
}

11. , ,
Ctrl+C, Ctrl+V, Ctrl+X Ctrl+Z . CEditView.
.
12. CNotePadView ClassView
Add Windows Message Handler.
Class or Object to Handle ID_EDIT_COPY.
New Windows Message/Handler COMMAND . , .
Existing Windows Message/Handler. OK ,
OnEditCopy, .
13. ID_EDIT_CUT, ID_
EDIT_PASTE ID_EDIT_UNDO.
14. , 5.22.
5.22
void CNotePadView::OnEditCopy()
{
CEditView::OnEditCopy();
UpdateViewWindow();
}
void CNotePadView::OnEditCut()
{
CEditView::OnEditCut();
UpdateViewWindow();
}
void CNotePadView::OnEditPaste()
{
CEditView::OnEditPaste();
UpdateViewWindow();
}
void CNotePadView::OnEditUndo()
{
CEditView::OnEditUndo();
UpdateViewWindow();
}

,
.

MFC

209

15.
( .txt).
CNotePadApp ClassView , OnInitInstance()
.
pDocTemplate = new CCeDocListDocTemplate , 5.23.
5.23
pDocTemplate = new CCeDocListDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CNotePadDoc),
RUNTIME_CLASS(CMainFrame),
// main SDI frame window
RUNTIME_CLASS(CNotePadView),
CString(_T("Text Files|*.txt||")));

16. . ,
.
CNotePadDoc, Serialize(CArchive& ar)
:
((CEditView*)m_viewList.GetHead())->SerializeRaw(ar);

! MFC .
.
,
. , , . MFC
,
.
NotePad , C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\
Samples\Mfc\Npp. ,
. , .
, -
. ,
MFC, .
, MFC
.
, .

.NET Compact Framework



Pocket PC Microsoft
Visual Studio .NET 2003

, , . , .NET . Java,
. .
C# Java, , . , .
, , , , , , .
.NET , C#
Microsoft Visual C++ , Visual Basic
Visual Basic .NET .

.NET Compact Framework


: .NET . Microsoft
- , , , .
, .NET
. .NET ,
, Microsoft,

.NET

211

. .NET , .

.NET
, .NET.
1. .NET Framework Microsoft Windows.
Windows XP Tablet Edition Windows Server 2003. Windows .NET Framework
Microsoft.
2. .NET Compact Framework Windows CE.
3. Shared Source Common Language Infrastructure (CLI)
CLI. Microsoft.
4. DotGNU GNU, .NET Framework .
dotgnu.org.
5. Mono Project , .NET Framework
. www.mono-project.com.

.NET
Microsoft .NET,
, -, , , ,
,
. , , ASP.NET, e .
, -, .NET , .NET
, .
.NET.
,
.

212

6. .NET Compact Framework

.NET
WebForms
WebForms . , . WebForms,
ASP.NET Microsoft Visual Studio .NET .NET.

WindowsForms
WebForms, WindowsForms
,
. ,
, .NET.

-
- .NET.
, . SOAP, RPC ( ), - .

.NET

, Win32 API, ,
, . Win32 API
( ,
, ),
, ,
, - . , Win32
,
,
. , , Microsoft, Windows . .NET

.NET

213

. .NET
- , , .

Common Intermediate Language


Microsoft Windows C/C++, .exe, PE (portable executble). ,
, . ,
.NET, .exe PE.
, ,
() Common Intermediate Language (CIL),
Microsoft Intermediate Language (MSIL) Intermediate Language (IL).
, .NET Framework. .NET Framework .
,
, .
JIT-compilation. native image cache, .

Common language runtime


,
, , . ,
, ,
.
(garbage collector), , . ,
.

Common Language Specification


,
, , . ,
, ,
, ,
, , IL. IL ,

214

6. .NET Compact Framework

, ,
, . , C VB .NET , IL
.

Common type system


,
, .NET.

Common Language Infrastructure


, .NET ECMA.
, , .NET.

Compact Framework
.NET Compact Framework .NET Framework, ,
. , JIT-, . .NET CF
Windows Forms, , XML XML.

Application domains
, .NET Compact Framework,
,
. Win32, Win32 .


.NET Compact Framework , . , .NET Framework, native image cache, Compact Framework
.


.NET Compact Framework . , ,
, .

Compact Framework

215

.NET
Framework Compact Framework
, .NET ,
. .
1. CLR CF 12 % .
2. COM- . COM- ActiveX-. API Windows CE . ,
Platform Invokation Service (PInvoke),
DLL, , , API.
3. ADO.NET
SQL Server CE .NET Data Provider
4. CF ASP.NET.
5. XML . XML shema validation.


.NET,
.
n .NET ,
. . (assembly) .NET, .
n (MetaData) ,
. .NET
. .
q (, ), , .
q , .
q , .
q , , , .
q .
n (Namespaces) ,

. , ,
. , (,
System.Data), .
Imports

216

6. .NET Compact Framework

. ,
System.Drawing.Image System.Drawing.Colors, , ( ) Imports System.Drawing, .
- Java.

() CF
. 6.1 .NET CF .
6.1. .NET CF

cgacutil.exe


CF (global assembly cache).

cmtnpt_
tcpaccept.dll

ConManClient.exe

11

ConManClient.
exe

Connection
Manager,

36

Microsoft.Visual
Basic.dll

, Visual Basic

136

Microsoft.
WindowsCE.
Forms.dll

, Windows
CE,
Software Input Panel
Windows

11

mscoree.dll

mscoree1_0.dll

13

mscoree1_0.dll

, -

461

mscorlib.dll

,

.NET. ,
-, , , , , ,
P/Invoke,
, , ,
, Object Value

383

netcfagl1_0.dll


System.Windows.Forms.dll -

107

System.Data.
Common.dll

106

System.Data.dll


ADO.NET

394

Compact Framework

217

System.Data.
SqlClient.dll


Microsoft SQL Server 7.0

145

System.Data.
SqlServerCe.dll


Microsoft SQL Server 2000 Windows CE Edition

121

System.dll

249

System.
Drawing.dll

, , bitmaps,
colors, fonts, pens, brushes icons

38

System.Net.
IrDA.dll

11

System.SR.dll

91

System.Web.
Services.dll

94

System.Windows. Data grid


Forms.DataGrid.
dll

38

System.Windows.
Forms.dll
Windows Forms. Application

137

System.Xml.dll

197

XML


.NET CF. System.SR.dll, System.Data.SqlClient.dll System.Data.SqlServerCe.dll
. ,
. ,
System.Drawing.dll , GAC_System.Drawing_v1_0_5000_
0_ cneutral_1.dll. ,
Global Assembly Cash (GAC). GAC , CF .

CF
. 6.2. ,
.
6.2.

System.Data

System.Collections

, (ArrayList, Hashtable,
Dictionary, Stack, SortedList Queue)

System.Configuration

XML

System.Diagnostics

.NET,
, -

218

6. .NET Compact Framework

6.2 ()

System.IO

System.Net

, -,

System.Reflection

System.Runtime.InteropService

,
COM-

System.Runtime.Remote

System.Text

System.Web

WebForms

System.Windows.Forms

WindowsForms

System.Threading

System.XML

XML

VB.NET:
VB 6
Microsoft .NET
VB.NET C#.NET. C#
Java, VB.NET Visual
Basic. ,
VB. Visual Basic 6 ,
, VB.NET . VB.NET .NET Framework,
, , C#.
, , , .
VB.NET.
n .
n - .
n .NET Framework.
n -
(delegates).

eVB Visual Basic .NET


VB .NET eVB VB Compact Framework CF.

eVB Visual Basic .NET

219


eVB - , Variant, eVB VB Script. Visual Basic .NET,
, ,
Variant. . 6.3 , VB .NET.
6.3. VB .NET

Boolean

True False

Byte

0 255

Char

Unicode

Date

Decimal

16

Double

Integer

32-

Long

64-

Object

Short

16-

Single

String

n/a

Unicode

, VB .NET
. , .
Dim strMyString As String = " "

VB .NET , .

. eVB, VB .NET

. , , ,
.
Label1.Text = ""

VB .NET
, .
,
.
MsgBox (" ")

220

6. .NET Compact Framework

, . VB .NET
.
VB .NET , C. ,
j = j + 1 j += 1.
.
.
C# VB .NET.


VB .NET eVB.
,
System.Data. VB .NET
, MS SQL Server, XML.
ADO.CE,
Pocket Access Windows CE.


VB .NET Try\Catch\Finally.

XML
.NET Framework XML
, , VB .NET
XML-. CF
XMLReader, XMLWriter XMLDocument.
XML VB .NET
-, XML.

VB.NET Compact Framework



, Pocket PC VB.NET Microsoft Visual Studio .NET 2003,
,
, .

VB.NET Compact Framework

221

6.1
1. Visual Studio .NET. ,
New Project (. 6.1).

. 6.1. New Project

File4New4Project.
(. 6.2).

. 6.2.

2. Project Types . Pocket


PC Visual Basic Visual C#.
Templates , . Visual Basic, Visual
C# Pocket PC Smart Device
Application. Name . , , Location.
3. Project Types Visual Basic,
Templates Smart Device Application.
Simple, . OK, ,
(. 6.3).

222

6. .NET Compact Framework

. 6.3. Smart Device Application

4. Pocket PC,
Windows Application. OK
Pocket PC.
, (. 6.4).

. 6.4. Windows Application

VB.NET Compact Framework

223

5. MainMenu1 .
, . 6.5.
.

. 6.5.

6. , Type Here ,
, , (. 6.6).

. 6.6.

7. , 6.1.
6.1
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MenuItem2.Click
MsgBox("", MsgBoxStyle.Information, "")
End Sub

8. . .
9. , . Deployment Device .

224

6. .NET Compact Framework

10. , . Solution Configurations .

11. , Debug Start (


) Start Without Debugging (
).
12. Pocket PC 2003 Emuliator, Release. Start
Without Debugging. , ,
.NET Run-time , , .
.
13.
.
.
, , , Embedded Visual C++. Autos,
Locals, Watch, , . , .
n Call Stack .
n Breakpoints .
n Command Window Visual Basic.
n Output .
n Task List ,
, .


, . .
. , ( ,
), , , .
, . ,

VB.NET Compact Framework

225

. , Pocket,
.
. , .
, , . (, , ) , , .
5 ( 10)
,
. , , ,
, , , .
, VB .NET Compact Framework.
.NET CF .

.NET CF
Visual Studio Toolbox, ,
Pocket PC, VB .NET (. 6.7).

. 6.7. .NET CF

226

6. .NET Compact Framework

eVB eVC. , ContextMenu, InputPanel


StatusBar. .
ContextMenu
, , Pocket PC - .
, . .
MenuItems, ,
.
Popup, , .
InputPanel
SIP (Software Input Panel),
.
Enabled.
, ,
. GotFocus , , LostFocus. VisibleDesktop , .
, .
StatusBar
. Text , Font .

, . , StatusBar
, 6.2.
6.2
Private Sub StatusBar1_ParentChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles StatusBar1.ParentChanged
'
End Sub

, 6.3.

VB.NET Compact Framework

227

6.3
Private Sub Nyam_nyam(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles StatusBar1.ParentChanged
'
End Sub

. ,
. , Handles, ,
. , , . 6.8, Ctrl+Space,
, .

. 6.8.

, , KeyDown, Method 'StatusBar1_ParentChanged' cannot handle Event


'KeyDown' because they do not have the same signature. ,
. KeyDown,
.
Go To Definition,
Object Browser (. 6.9).

. 6.9. KeyDown Object Browser

, ,
, .
.

228

6. .NET Compact Framework


,
.
. . , ,
.
: MainMenu, Timer, ImageList, ContextMenu, OpenFileDialog, SaveFileDialog
InputPanel. ,
(. 6.10).

. 6.10.

6.2
1. Smart Device Application MyTime.
Windows Application, Pocket PC,
. .
2.
, . 6.4.
6.4.

Left.jpg

1624

Right.jpg

1624

Add.jpg

2424

Edit.jpg

2424

Delete.jpg

2424

3. .
Visual Studio
Properties, .
,
Form1 Properties.
Text ,
. .
4. , . Project

VB.NET Compact Framework

229

MyTime Properties. Common


Properties Device.
Output file folder \Windows\Start Menu,
OK. , .
5. .
Common Properties
Build. Application Icon
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Graphics\icons\Misc\
CLOCK06.ICO. .
Solution Explorer , Properties Build Action Embedded Resource.
, ,
.
6.
. 6.5.
6.5.

PictureBox1

Image

Left.jpg

SizeMode

StretchImage

Location

0; 0

PictureBox2

PictureBox3

PictureBox4

PictureBox5

Label1

Size

16; 24

Image

Right.jpg

SizeMode

StretchImage

Location

152; 0

Size

16; 24

Image

Add.jpg

SizeMode

StretchImage

Location

170; 0

Size

22; 24

Image

Edit.jpg

SizeMode

StretchImage

Location

194; 0

Size

22; 24

Image

Delete.jpg

SizeMode

StretchImage

Location

218; 0

Size

22; 24

Text
TextAlign

TopCenter

Location

16; 0

Size

136; 24

230

6. .NET Compact Framework

, . 6.11.

. 6.11.

7. ListView.
, . 6.6.
6.6. ListView

Location

0; 24

Size

240; 246

FullRowSelect

True

View

Details

HeaderStyle

NonClickable

8. Properties Columns
.
ListView (. 6.12).

. 6.12. ListView

9. Add, ,
. 6.7.

VB.NET Compact Framework

231

6.7. ListView
Name

Text

Width

Category

120

StartOf

50

EndOf

50

Note

120

OK.
10. MainMenu1,
. (. 6.13). , .

. 6.13.

11. . Deployment Device


Pocket PC 2003 Emulator, Solution Configurations Debug. Debug4Start
.
.NET, .
12. (
ListView),
,
. , .
13. Project4Add Windows Form.
. , Open, Form2.vb.
14. MainMenu
InputPanel.
15. Form2 . 6.8.
6.8.

Label1

Text

TextAlign

TopCenter

Location

0; 0

Size

96; 16

232

6. .NET Compact Framework

6.8 ()

Label2

Text

TextAlign

TopCenter

Location

96; 0

Size

72; 16

Text

TextAlign

TopCenter

Location

168; 0

Size

70; 16

Text

TextAlign

TopCenter

Location

0; 40

Size

240; 16

Location

0; 16

Size

98; 21

Location

98; 16

Size

72; 21

Location

170; 16

Size

72; 21

Location

0; 56

Size

240; 104

MultiLine

True

Text

Location

32; 168

Size

72; 24

Text

Location

128; 168

Size

72; 24

Label3

Label4

ComboBox1
ComboBox2
ComboBox3
TextBox1

Button1

Button2

16.
, . 6.14.

. 6.14.

VB.NET Compact Framework

233

XML
.NET CF
XML- XML-.
, XML, XMLTextReader XMLDocument.
XMLDocument, XMLTextReader ,
.
XML ( ) .
HTML, XML .
HTML, XML . , , , , ,
, , . , XML-, , .
XML- 6.4.
6.4
<?xml version="1.0" encoding="windows-1251"?>
<Y2005>
<Date>
<Index value = "0"/>
</Date>
<Date>
<Index value = "1"/>
</Date>
<Date>
<Index>2
</Index>
</Date>
</Y2005>

XML-. XML , .
Y2005. (<Y2005>) (</Y2005>) . Y2005 Date. Date , . Date
Index. Index , ,
. Index value. ,
, . , . .
XML- ,
. Y2005.
XML-?
, , ,
, ,
. XML- 6.5.

234

6. .NET Compact Framework

6.5
:
<?xml version="1.0" encoding="windows-1251"?>
:
<Y2005>
Date, :
<Date value = "20.08.2005" nt = "1">
Index, :
<Index Category="Work1" StartOf= "00.00" EndOf = "00.20" Note=""/>
<Index Category="Misc" StartOf= "00.20" EndOf = "00.40" Note=""/>
</Date>

</Y2005>

Date . value , Cnt


. Index . Category , StartOf ,
EndOf , Note
.
,
.

6.2 ()
17. ,
2005.xml, ,
Category.xml, .
, . , . .
. Solution Explorer
Form1.vb View
Code. , 6.6.
6.6
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents ListView1 As System.Windows.Forms.ListView
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
'
Dim D As DateTime
Dim dirStr As String

18. ,
6.7.
6.7
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
' , ,
' ,

VB.NET Compact Framework

', dirStr
dirStr = IO.Path.GetDirectoryName_
(Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase.ToString)
', c
If Not System.IO.File.Exists(dirStr + "\2005.xml") Then
'
' XmlDocument
Dim myxmlDoc As New Xml.XmlDocument
'
Dim oROOT As Xml.XmlElement = myxmlDoc.CreateElement("Y2005")
myxmlDoc.AppendChild(oROOT)
' myDate
Dim myDate As Date = Date.Now
myDate = DateAdd(DateInterval.Day, -1, myDate)
' Data
While Not myDate.ToShortDateString = "31.12.2005"
myDate = DateAdd(DateInterval.Day, 1, myDate)
Dim oData As Xml.XmlElement = myxmlDoc.CreateElement("Data")
oROOT.AppendChild(oData)
Dim oValue As Xml.XmlAttribute = _ myxmlDoc.CreateAttribute("value")
Dim oIndex As Xml.XmlAttribute = _ myxmlDoc.CreateAttribute("Cnt")
oValue.InnerText = myDate.ToShortDateString
oIndex.InnerText = "-1"
oData.SetAttributeNode(oValue)
oData.SetAttributeNode(oIndex)
End While
' XML
Dim myPI As Xml.XmlProcessingInstruction = _
myxmlDoc.CreateProcessingInstruction_
("xml", "version='1.0' encoding='windows-1251'")
myxmlDoc.InsertBefore(myPI, myxmlDoc.ChildNodes(0))
'
myxmlDoc.Save(dirStr + "\2005.xml")
End If
' ,
' Work1, Work2, Work3, Misc, Trash
If Not System.IO.File.Exists(dirStr + "\Category.xml") Then
Dim myxmlDoc As New Xml.XmlDocument
Dim oROOT As Xml.XmlElement = myxmlDoc.CreateElement("Categoty")
myxmlDoc.AppendChild(oROOT)
Dim oWork1 As Xml.XmlElement = myxmlDoc.CreateElement("Work1")
oROOT.AppendChild(oWork1)
Dim oWork2 As Xml.XmlElement = myxmlDoc.CreateElement("Work2")
oROOT.AppendChild(oWork2)
Dim oWork3 As Xml.XmlElement = myxmlDoc.CreateElement("Work3")
oROOT.AppendChild(oWork3)
Dim oMisc As Xml.XmlElement = myxmlDoc.CreateElement("Misc")
oROOT.AppendChild(oMisc)
Dim oTrash As Xml.XmlElement = myxmlDoc.CreateElement("Trash")
oROOT.AppendChild(oTrash)
Dim myPI As Xml.XmlProcessingInstruction = _
myxmlDoc.CreateProcessingInstruction_
("xml", "version='1.0' encoding='windows-1251'")
myxmlDoc.InsertBefore(myPI, myxmlDoc.ChildNodes(0))
myxmlDoc.Save(dirStr + "\Category.xml")
End If
D = DateTime.Now
Label1.Text = System.DateTime.Today.ToShortDateString
' ListView
Data_Load(System.DateTime.Today.ToShortDateString)
End Sub

235

236

6. .NET Compact Framework

XML-, XMLDocument, XML- . XML ,


, , , .
,
. Pocket PC ,
, .
19. ListView 6.8.
6.8
Private Sub Data_Load(ByVal MyDate As String)
' , ,
' dirStr
dirStr = IO.Path.GetDirectoryName_
(Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase.ToString)
' XmlTextReader
Dim xmlrdrMy As New Xml.XmlTextReader(dirStr + "\2005.xml")
Dim MyCount, MyIndex As Integer
Dim lvItem As ListViewItem
'
xmlrdrMy.WhitespaceHandling = xmlrdrMy.WhitespaceHandling.None
' ,
xmlrdrMy.MoveToContent()
' , ListView
' Index Index
' ListView
ListView1.Items.Clear()
ListView1.Refresh()
While Not xmlrdrMy.EOF
If xmlrdrMy.Name = "Data" Then
If xmlrdrMy.GetAttribute("value") = MyDate Then
MyIndex = CInt(xmlrdrMy.GetAttribute("Cnt"))
For MyCount = 0 To MyIndex - 1
xmlrdrMy.Read()
lvItem = New ListViewItem(xmlrdrMy.GetAttribute("Category"))
ListView1.Items.Add(lvItem)
ListView1.Items.Item(MyCount).SubItems.Add_
(xmlrdrMy.GetAttribute("StartOf"))
ListView1.Items.Item(MyCount).SubItems.Add(xmlrdrMy.GetAttribute("EndOf"))
ListView1.Items.Item(MyCount).SubItems.Add(xmlrdrMy.GetAttribute("Note"))
Next
End If
End If
' XML
xmlrdrMy.Read()
End While
'
xmlrdrMy.Close()
End Sub

VB.NET Compact Framework

237

XmlTextReader . XmlTextReader XML-, ,


.
Read().
20. .
,
. 6.9.
6.9
Private Sub Data_Save(ByVal MyDate As String)
Dim MyCount, MyIndex As Integer
' XmlDocument
Dim myxml As New Xml.XmlDocument
dirStr = IO.Path.GetDirectoryName_
(Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase.ToString)
' XmlDocument
myxml.Load(dirStr + "\2005.xml")
' Data
For MyCount = 0 To myxml.ChildNodes(1).ChildNodes.Count - 1
If myxml.ChildNodes(1).ChildNodes(MyCount).Attributes(0).InnerText = MyDate Then
'
myxml.ChildNodes(1).ChildNodes(MyCount).RemoveAll()
' ListView.
' Data Index
' ListView
' value Data
Dim myValue As Xml.XmlAttribute = myxml.CreateAttribute("value")
' value
myValue.InnerText = MyDate
' value Data
myxml.ChildNodes(1).ChildNodes(MyCount).Attributes.Append(myValue)
' Cnt
Dim mIndex As Xml.XmlAttribute = myxml.CreateAttribute("Cnt")
mIndex.InnerText = ListView1.Items.Count
myxml.ChildNodes(1).ChildNodes(MyCount).Attributes.Append(mIndex)
' Data Index
For MyIndex = 0 To ListView1.Items.Count - 1
Dim oIndex As Xml.XmlElement = myxml.CreateElement("index")
myxml.ChildNodes(1).ChildNodes(MyCount).AppendChild(oIndex)
Dim oCategory As Xml.XmlAttribute = myxml.CreateAttribute("Category")
oCategory.InnerText = ListView1.Items(MyIndex).SubItems(0).Text
myxml.ChildNodes(1).ChildNodes(MyCount).ChildNodes_
(MyIndex).Attributes.Append(oCategory)
Dim oStartOf As Xml.XmlAttribute = myxml.CreateAttribute("StartOf")
oStartOf.InnerText = ListView1.Items(MyIndex).SubItems(1).Text
myxml.ChildNodes(1).ChildNodes(MyCount).ChildNodes_
(MyIndex).Attributes.Append(oStartOf)
Dim oEndOf As Xml.XmlAttribute = myxml.CreateAttribute("EndOf")
oEndOf.InnerText = ListView1.Items(MyIndex).SubItems(2).Text
myxml.ChildNodes(1).ChildNodes(MyCount).ChildNodes_
(MyIndex).Attributes.Append(oEndOf)
Dim oNote As Xml.XmlAttribute = myxml.CreateAttribute("Note")
oNote.InnerText = ListView1.Items(MyIndex).SubItems(3).Text
myxml.ChildNodes(1).ChildNodes(MyCount).ChildNodes_

238

6. .NET Compact Framework

(MyIndex).Attributes.Append(oNote)
Next
' Data,
Exit For
End If
Next
'
myxml.Save(dirStr + "\2005.xml")
End Sub

21. . ListView,
PictureBox, .
, ,
.
22. Project4Add Module. . Name
Data, Open.
. ,
6.10.
6.10
Module Data
Public categorySt, startOfSt, endOfSt, noteSt As String
End Module

23.
6.11.
6.11
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Data_Save(Label1.Text)
End Sub

24. PictureBox1,
, 6.12.
6.12
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox1.Click
Data_Save(Label1.Text)
D = DateAdd(DateInterval.Day, -1, D)
Label1.Text = D.ToShortDateString
Data_Load(D.ToShortDateString)
End Sub

25. PictureBox2,
, 6.13.

VB.NET Compact Framework

239

6.13
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox2.Click
Data_Save(Label1.Text)
D = DateAdd(DateInterval.Day, 1, D)
Label1.Text = D.ToShortDateString
Data_Load(D.ToShortDateString)
End Sub

26. PictureBox3,
, 6.14.
6.14
Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox3.Click
Dim lvIt As ListViewItem
'
Dim MyForm As New Form2
' , , 3
MyForm.Send = 3
' ListView ,
' ,
'
If ListView1.Items.Count > 0 Then
categorySt = ListView1.Items.Item_
(ListView1.Items.Count - 1).SubItems(0).Text
startOfSt = ListView1.Items.Item_
(ListView1.Items.Count - 1).SubItems(2).Text
endOfSt = startOfSt
noteSt = ""
Else
categorySt = ""
startOfSt = ""
endOfSt = ""
noteSt = ""
End If
'
If MyForm.ShowDialog() = DialogResult.OK Then
' OK,
' ListView
lvIt = New ListViewItem(categorySt)
ListView1.Items.Add(lvIt)
ListView1.Items.Item.(ListView1.Items.Count - 1).SubItems.Add(startOfSt)
ListView1.Items.Item.(ListView1.Items.Count - 1).SubItems.Add(endOfSt)
ListView1.Items.Item.(ListView1.Items.Count - 1).SubItems.Add(noteSt)
End If
End Sub

27. PictureBox4, , 6.15.


6.15
Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox4.Click
' ListView ,
If ListView1.SelectedIndices.Count > 0 Then
Dim MyForm As New Form2

240

6. .NET Compact Framework

' , 4
MyForm.Send = 4
'
categorySt = ListView1.Items(ListView1.SelectedIndices_(0)).SubItems(0).Text
startOfSt = ListView1.Items(ListView1.SelectedIndices(0)).SubItems(1).Text
endOfSt = ListView1.Items(ListView1.SelectedIndices(0)).SubItems(2).Text
noteSt = ListView1.Items(ListView1.SelectedIndices(0)).SubItems(3).Text
' OK,
' ListView
If MyForm.ShowDialog() = DialogResult.OK Then
ListView1.Items(ListView1.SelectedIndices(0)).SubItems(0).Text = categorySt
ListView1.Items(ListView1.SelectedIndices(0)).SubItems(1).Text = startOfSt
ListView1.Items(ListView1.SelectedIndices(0)).SubItems(2).Text = endOfSt
ListView1.Items(ListView1.SelectedIndices(0)).SubItems(3).Text = noteSt
End If
End If
End Sub

28. PictureBox5 ( )
6.16.
6.16
Private Sub PictureBox5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PictureBox5.Click
If ListView1.SelectedIndices.Count > 0 Then
ListView1.Items.Remove(ListView1.Items(ListView1.SelectedIndices(0)))
End If
End Sub

29. , . Send,
6.17.
6.17
Public Class Form2

Public Send As Integer

30. . , , .
, 6.18.
6.18
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Dim myCount As Integer
Dim myStrTime As String
ComboBox2.Items.Clear()
ComboBox3.Items.Clear()
' ,
' 00.00 23.55 c
' 5
For myCount = 0 To 287

VB.NET Compact Framework

241

Dim myTime1 As TimeSpan = TimeSpan.FromMinutes(myCount * 5)


myStrTime = myTime1.ToString()
myStrTime = myStrTime.Substring(0, 5)
ComboBox2.Items.Add(myStrTime)
ComboBox3.Items.Add(myStrTime)
Next
' ComboBox1
Dim myxmlDoc As New Xml.XmlDocument
Dim dirStr As String
dirStr = IO.Path.GetDirectoryName_
(Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase.ToString)
ComboBox1.Items.Clear()
myxmlDoc.Load(dirStr + "\Category.xml")
For myCount = 0 To myxmlDoc.ChildNodes.Item(1).ChildNodes.Count - 1
ComboBox1.Items.Add_ (myxmlDoc.ChildNodes.Item(1).ChildNodes.Item(myCount).Name)
Next
ComboBox1.SelectedIndex = 0
ComboBox2.SelectedIndex = 0
ComboBox3.SelectedIndex = 0
' ComboBox1 ,
' ListView
For myCount = 0 To ComboBox1.Items.Count - 1
If ComboBox1.Items(myCount) = categorySt Then
ComboBox1.SelectedIndex = myCount
Exit For
End If
Next
' ComboBox
For myCount = 0 To ComboBox2.Items.Count - 1
If ComboBox2.Items(myCount) = startOfSt Then
ComboBox2.SelectedIndex = myCount
Exit For
End If
Next
For myCount = 0 To ComboBox3.Items.Count - 1
If ComboBox3.Items(myCount) = endOfSt Then
ComboBox3.SelectedIndex = myCount
Exit For
End If
Next
TextBox1.Text = noteSt
End Sub

31. OK 6.19.
6.19
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
'
categorySt = Me.ComboBox1.Text
startOfSt = Me.ComboBox2.Text
endOfSt = Me.ComboBox3.Text
noteSt = Me.TextBox1.Text
'
DialogResult = DialogResult.OK
'
Me.Close()
End Sub

242

6. .NET Compact Framework

32. Cancel
6.20.
6.20
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
DialogResult = DialogResult.Cancel
Me.Close()
End Sub

33. , (
) TextBox.
6.21.
6.21
Private Sub TextBox1_GotFocus(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.GotFocus
InputPanel1.Enabled = True
End Sub
Private Sub TextBox1_LostFocus(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.LostFocus
InputPanel1.Enabled = False
End Sub

, , , . .
, , , , 2005.xml.


, ,
.
, .
, .NET CF , VB.NET DateTime Picker.
, , , .NET CF. Microsoft.
www.microsoft.com
DateTimePickerDesignTimeSampleSetup.exe.
. Adding Designer Support to the .NET Compact Framework DateTimePicker
Control, . download.microsoft.com/download/c/0/a/c0a7cea4-e9c14e80-9e5a-afed9a664876/DateTimePickerDesignTimeSampleSetup.exe.

VB.NET Compact Framework

243

, .
. C:\
Program Files\.NET Compact Framework Samples\DateTimePicker DesignTime Sample.
,
.
n C:\Program Files\.NET Compact Framework Samples\DateTimePicker DesignTime
Sample\code\CS DateTimePickerControl.sln
.
n Visual Studio Deploy Solution.
n Visual Studio.
n C:\Program Files\.NET Compact Framework Samples \DateTimePicker
DesignTime Sample\code\CS\DateTimePickerControl.Deployment \Debug,
Setup.exe, . DateTime Picker.
.

6.2 ()
34. Form1.vb Label1 DateTimePicker, ToolBox.

. 6.15. DateTimePicker

35. Form1_Load
Label1.Text = System.DateTime.Today.ToShortDateString

36.
DateTimePicker1.Value = System.DateTime.Today

37. PictureBox1_Click PictureBox2_Click Data_Save(Label1.Text)


Data_Save(DateTimePicker1.Value.ToShortDateString).
38. Form1_Closing Data_Save(Label1.Text)
Data_Save(DateTimePicker1.Value.ToShortDateString).

244

6. .NET Compact Framework

39. Form1_Closing Data_Save(Label1.Text)


Data_Save(DateTimePicker1.
Value.ToShortDateString).
40.
Dim dtpClick As Boolean.
41. , 6.22.
6.22
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles DateTimePicker1.ValueChanged
If dtpClick = True Then
Data_Save(D.ToShortDateString)
D = DateTimePicker1.Value
Data_Load(D.ToShortDateString)
dtpClick = False
End If
End Sub
Private Sub DateTimePicker1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles DateTimePicker1.Click
dtpClick = True
End Sub

42. .
DateTimePicker ,
. 6.16.

. 6.16. DateTimePicker

43. .
ContextMenu. ,
, ,
. 6.17.

VB.NET Compact Framework

245

. 6.17.

44. .
, 6.23.
6.23
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MenuItem1.Click
PictureBox3_Click(sender, e)
End Sub
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MenuItem2.Click
PictureBox4_Click(sender, e)
End Sub
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MenuItem3.Click
PictureBox5_Click(sender, e)
End Sub

45. ListView1 Properties


ContextMenu ContextMenu1.
46.
ListView .
, , PictureBox (. 6.18).

. 6.18. ListView

47. ImageList. , Properties Images. Add ,


Add.jpg, Edit.jpg Delete.jpg.

246

6. .NET Compact Framework

48. ToolBar.
Properties ImageList.
ImageList1. Buttons.
.
Add ImageIndex , ,
0, 1 2 .
49. .
, .
.
, , . . , , .
, , ,
. .

DataSet
,
. XML,
. .NET CF , DataSet.
, ,
, DataGrid, DataSet, DataTable XML.

6.3
1. VB .NET Pocket PC XMLDBLocal.
2. Project4Add Existing Item,
Form2.vb MyTime . data.vb.
3. MainMenu, ImageList ToolBar,
.
DataGrig, . 6.19.
4. Category.xml MyTime XMLDBLocal.
5. .
. ,
6.24.

VB.NET Compact Framework

247

. 6.19.
6.24
Dim
Dim
Dim
Dim

ds As DataSet = New DataSet


dt As DataTable = New DataTable
D As DateTime
strTime, strFileName, dirStr As String

6. , , 6.25.
6.25
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
' , DataGrid
' , ,
'
Dim mFont As Font = New Font("Arial", 10, FontStyle.Bold)
DataGrid1.Font = mFont
'
D = DateTime.Now
strTime = D.ToShortDateString
strTime = strTime.Replace(".", "_")
strFileName = "\" + strTime + ".xml"
dirStr = IO.Path.GetDirectoryName_
(Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase.ToString)
' ,
If Not IO.File.Exists(dirStr + strFileName) Then
' , .
' ,
Dim myCount As Integer
Dim dcCat As New System.Data.DataColumn("Category")
dt.Columns.Add(dcCat)
Dim dcStartOf As New System.Data.DataColumn("StartOf")
dt.Columns.Add(dcStartOf)
Dim dcEndOf As New System.Data.DataColumn("EndOf")
dt.Columns.Add(dcEndOf)
Dim dcNote As New System.Data.DataColumn("Note")
dt.Columns.Add(dcNote)

248

6. .NET Compact Framework

' . DataGrid
dt.TableName = "myTable"
' DataSet.
ds.Tables.Add(dt)
Else
' DataSet , Dataset
ds.ReadXml(dirStr + strFileName)
End If
' DataGrid DataSet,
'Dataset .
'
DataGrid1.DataSource = ds.Tables(0)
' DataGrid
DataGrid1.ColumnHeadersVisible = True
End Sub

7. , 6.26.
6.26
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
If e.Button Is ToolBarButton1 Then
Dim str(3) As String
Dim editFrm As New Form2
editFrm.Send = 3
Dim countInt As Integer
If ds.Tables(0).Rows.Count <> 0 Then
countInt = ds.Tables(0).Rows.Count - 1
categorySt = ds.Tables(0).Rows(countInt).Item(0)
startOfSt = ds.Tables(0).Rows(countInt).Item(2)
endOfSt = ds.Tables(0).Rows(countInt).Item(2)
noteSt = ""
Else
categorySt = ""
startOfSt = ""
endOfSt = ""
noteSt = ""
End If
If editFrm.ShowDialog = DialogResult.OK Then
str(0) = categorySt
str(1) = startOfSt
str(2) = endOfSt
str(3) = noteSt
ds.Tables(0).Rows.Add(str)
ds.WriteXml(dirStr + strFileName)
End If
End If
End Sub

, .
Form2.vb Data.vb .
. , . 6.20.

VB.NET Compact Framework

249

. 6.20. DataGrid

, . , .
8. .
DataGrid1 ,
TableStyles. . Add ,
, MyTable MappingName.
GridColumnStyles . .
Add , . . 6.9.
6.9. DataGrid
Header Text

MappingName

Width

Category

120

StartOf

50

EndOf

50

Note

120

9. . , DataGrid , -
MappingName,
. , , - , . ,
. , . 6.21.

250

6. .NET Compact Framework

. 6.21. DataGrid


,
.
System.Data. . 6.10. , , , MS SQL Server SQL Server Pocket PC.
6.10.
()

SqlConnection

System.Data.SqlClient

MS SQL Server,

SqlCeConnection

System.Data.SqlServerCe

SQL Server CE,


Pocket PC

SqlCommand

System.Data.SqlClient

SQL- MS SQL Server


SQL Server CE

SqlCeCommand

System.Data.SqlServerCe

SqlDataReader

System.Data.SqlClient

SqlCEDataReader

System.Data.SqlServerCe

SqlDataAdapter

System.Data.SqlClient

SqlCeDataAdapter

System.Data.SqlServerCe

DataSet

System.Data

,
DataSet
,

,

VB.NET Compact Framework

251

()

DataTable

System.Data

, ,
DataSet

DataRow

System.Data

,
DataTable

DataColumn

System.Data

,
DataTable

DataView

System.Data

, ,
.

DataColumn
DataColumn DataTable. DataTable,
.
DataSet , . DataSet
DataAdapter XML,
.
DataColumn . GetType()
( System.Data.DataColumn), ToString() .
, DataColumn.
. 6.11.
6.11. DataColumn

AllowDBNull

, (NULL)

AutoIncrement

, (
)

AutoIncrementSeed

AutoIncrementStep

, .
,

Caption

Column Mapping

ColumnName

DataType

DefaultValue

Expression

252

6. .NET Compact Framework

6.11 ()

ExtendedProperties

MaxLength

Namespace

Ordinal

Prefix

XML,

ReadOnly

Table

Unique

DataRow
DataRow DataTable.
.
DataRow . 6.12 6.13.
6.12. DataRow

AcceptChanges

, ,

BeginEdit

CancelEdit

ClearErrors

Delete

EndEdit

GetChildRows

GetColumnError

GetColumnsInError

GetParentRow

GetParentRows

GetType

HasVersion

IsNull

, NULL

RejectChanges

, AcceptChanges

SetColumnError

SetParentRow

VB.NET Compact Framework

253

6.13. DataRow

HasErrors

Item

ItemArray

RowError

RowState

Table

DataTable
DataTable . , , . , .
. 6.14 6.15 DataTable.
6.14. DataTable

AcceptChanges

, , AcceptChanges

BeginInit

BeginLoadData

Clear

Clone

Compute

EndInit

EndLoadData

GetErrors

GetType

ImportRow

, ,

LoadDataRow

.
,

NewRow

RejectChanges

,
AcceptChanges

Reset

Select

ToString

254

6. .NET Compact Framework

6.15. DataTable

CaseSensitive

ChildRelations

Child Relations

Columns

Constraints

DataSet

DataSet,

DefaultView

DisplayExpression

ExtendedProperties

HasErrors

Locale

MinimumCapacity

Namespace

XML

ParentRelations

Parent Relations

Prefix

XML
XML

PrimaryKey

Rows

TableName

DataSet
DataSet .
,
. DataColumn, DataRow DataTable DataSet, DataAdapter
. ,
DataSet.
DataSet .NET
CF. , -
. DataSet . 6.16 6.17.
SqlDataAdapter SqlCeDataAdapter
,
DataSet . DataSet .
. 6.18 6.19.

VB.NET Compact Framework

255

6.16. DataSet

AcceptChanges

, , AcceptChanges

BeginInit

Clear

DataSet

Clone

Dataset ,

EndInit

GetType

GetXml

, Dataset, XML

GetXmlSchema

XSD

HasChanges

, DataSet ,

InterXmlSchema

XML- XMLReader DataSet

ReadXml

DataSet XML-
XMLReader

ReadXmlSchema

DataSet XML- XMLReader

RejectChanges

DataSet AcceptChanges

Reset

DataSet

WriteXml

XML- XMLReader

WriteXmlSchema

XML- XMLReader

6.17. DataSet

CaseSensitive

, DataSet

DataSetName

DataSet

DefaultViewManager

DataSet,
,
DataViewManager

EnforceConstraints

ExtendedProperties

, DataSet

HasErrors

, DataSet

Locale

Namespace


Dataset XML

Prefix

XML-
XML

Relations

DataSet

Tables

DataSet

256

6. .NET Compact Framework

6.18. SqlDataAdapter SqlCeDataAdapter

Fill

DataSet

DataSet DataTable

FillSchema

DataTable DataSet
,
SchemaType

GetFillParameters

, SELECT

GetType

Update

INSERT, UPDATE DELETE


,
DataSet

6.19. SqlDataAdapter SqlCeDataAdapter

AcceptChangesDuringFill

, ,
AcceptChanges DataRow
DataTable Fill

ContinueUpdateOnError

, ,

DeleteCommand

SQL

InsertCommand

SQL,

MissingMappingAction

, ,

MissingSchemaAction

, , DataSet

SelectCommand

SQL-

TableMappings

,
DataTable

UpdateCommand

SQL-

SqlDataReader SqlCEDataReader
SqlDataReader SqlCEDataReader .
. 6.20 6.21.

VB.NET Compact Framework

257

6.20. SqlDataReader SqlCeDataReader

Close

DataReader

GetBoolean, GetByte,
GetDateTime, GetDecimal,
GetDouble, GetFloat,
GetGuid, GetInt16,
GetInt32, GetInt64,
GetSqlBinary,
GetSqlBoolean, GetSqlByte,
GetSqlDateTime,
GetSqlDecimal,
GetSqlDouble, GetSqlGuid,
GetSqlInt16, GetSqlInt32,
GetSqlInt64, GetSqlMoney,
GetSqlSingle, GetSqlString,
GetString

GetType

Seek

, ,
,

GetBytes

GetChars

GetDataTypeName

GetFieldType

GetOrdinal

GetSchemaTable

GetValue

IsDBNull

, ,

Read

DataReader

6.21. SqlDataReader SqlCeDataReader

Depth

FieldCount

IsClosed

, DataReader

Item

RecordsAffected

, , SQL

SqlCommand SqlCeCommand
SQL- .
. 6.22 6.23.

258

6. .NET Compact Framework

6.22. SqlCommand SqlCeCommand

Cancel

CreateParameter

SQLParameter SQLCEParameter

ExecuteNonQuery

ExecuteReader

DataReader

ExecuteXmlReader,
SqlCommand

CommandText
XmlReader

ExecuteScalar

, ,

Prepare

SetRange

ResetCommandTimeout,
SqlCommand


CommandTimeout

6.23. SqlCommand SqlCeCommand

CommandText

SQL-

CommandTimeout

CommandType

Connection

Connection,

IndexName

Parameters

Transaction

UpdatedRowSource,
SqlCommand


DataRow Update

SqlConnection SqlCeConnection
. . 6.24 6.25.
6.24. SqlConnection SqlCeConnection

BeginTransaction

ChangeDatabase

Close

CreateCommand

Command

Open

VB.NET Compact Framework

259

6.25. SqlConnection SqlCeConnection

ConnectionString

ConnectionTimeout

Database

DataSource

State

PacketSize,
SqlConnection

ServerVersion,
SqlConnection

WorkstationId,
SqlConnection

SQL Server CE

SQL Server CE ,
- . MS Visual Studio 2003 .
References (
Solution Explorer), SQL Server CE
, .
, (),
, .
n < Microsoft Visual Studio .NET>\CompactFrameworkSDK\
v1.0.5000\Windows CE sqlce.chm, , SQL Server CE,
Microsoft SQL Server CE Server Tools ( sqlce20sql2ksp1.exe sqlce20sql2ksp2.exe).
n < Microsoft Visual Studio .NET>\CompactFrameworkSDK\
v1.0.5000\Windows CE\wce300\< > < Microsoft Visual
Studio .NET>\CompactFrameworkSDK \v1.0.5000\Windows CE\wce400\< > ,

, System.Data.SqlServerCe System.Data.SqlClient.
n < Microsoft Visual Studio .NET>\CompactFrameworkSDK\
v1.0.5000\Windows CE\Samples
Pocket PC WindowsCE.

, , , ,
, .

260

6. .NET Compact Framework

SQL Server CE,


, () .
. . , .

6.4
1. VB .NET Pocket PC myDB.
2. System.Data.Common System.Data.
SqlServerCe. Project4Add reference
, ,
System.Data.Common. System.Data.
SqlServerCe, OK.
Solution Explorer, References.
SQL Server CE .
3.
,
. .
q < Microsoft Visual Studio
.NET 2003>\CompactFrameworkSDK\v1.0.5000\Windows CE\Samples\VB\Pocket PC\
NorthwindCE NorthwindDemo.sdf.

, .
Project4Add Existing Item. ,
, NorthwindDemo.sdf . .
Solution Explorer , ,
Properties Build action Content.
, .
Build4Deploy Solution.
,
, ,
NorthwindDemo.sdf. ,
,
My Documents.
q Start4Programms SQLCE
Query. Query Analyzer ,
SQL Server CE .
. (. 6.22).


. Path, NorthwindDemo.sdf, Connect.
Databases Query Analyzer . , , . Query Analyzer,

VB.NET Compact Framework

261

. .

. 6.22. SQL Server CE

q NorthwindDemo.sdf , , , . . ,
, ,
, OK. NorthwindDemo.sdf .
File Explorer, , \\< >\< > OK. ,
NorthwindDemo.sdf .

.
4. Button, Label TextBox , . 6.23, Text.

. 6.23.

262

6. .NET Compact Framework

5. ,
6.27.
6.27
Dim dbc As SqlServerCe.SqlCeConnection
Dim dbcm As SqlServerCe.SqlCeCommand = New
_SqlServerCe.SqlCeCommand("SELECT * FROM Customers")
Dim dba As SqlServerCe.SqlCeDataAdapter
Dim dbt As DataTable

6. Connect, 6.28.
6.28
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
'
dbc = New SqlServerCe.SqlCeConnection
'
dbc.ConnectionString = "Data Source=\NorthwindDemo.sdf"
'
dbt = New DataTable("Customers")
'
dbcm.Connection = dbc
' ,
dba = New SqlServerCe.SqlCeDataAdapter(dbcm)
' ,
' dba.Fill(dbt)
'
TextBox4.DataBindings.Add("Text", dbt, "CustomerID")
TextBox5.DataBindings.Add("Text", dbt, "CompanyName")
TextBox6.DataBindings.Add("Text", dbt, "ContactName")
TextBox7.DataBindings.Add("Text", dbt, "City")
TextBox8.DataBindings.Add("Text", dbt, "Country")
TextBox9.DataBindings.Add("Text", dbt, "Phone")
TextBox10.DataBindings.Add("Text", dbt, "FAX")
End Sub

7. Disconnect, 6.29.
6.29
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
dbc.Close()
dbt.Clear()
TextBox4.DataBindings.Clear()
TextBox5.DataBindings.Clear()
TextBox6.DataBindings.Clear()
TextBox7.DataBindings.Clear()
TextBox8.DataBindings.Clear()
TextBox9.DataBindings.Clear()
TextBox10.DataBindings.Clear()
End Sub

VB.NET Compact Framework

263

,
.
8. , , 6.30.
6.30
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
'
Me.BindingContext(dbt).Position -= 1
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
'
Me.BindingContext(dbt).Position = 0
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button6.Click
'
Me.BindingContext(dbt).Position = Me.BindingContext(dbt).Count - 1
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button5.Click
'
Me.BindingContext(dbt).Position += 1
End Sub

9. Connect. TextBox
Customers. ,
.
Disconnect TextBox (. 6.24).

. 6.24.

264

6. .NET Compact Framework


. .
10. , , . 6.25.

. 6.25.

11. , .
Me.BindingContext(dbt).CancelCurrentEdit()

12. 6.31.
6.31
Dim cmd As SqlServerCe.SqlCeCommand
cmd = New SqlServerCe.SqlCeCommand_
("UPDATE Customers SET Country = '" + TextBox8.Text + "' WHERE _
CustomerID = " + TextBox4.Text + "'", dbc)
If dbc.State = ConnectionState.Closed Then
dbc.Open()
End If
cmd.ExecuteNonQuery()

13. , .
, Connect, Country V.
Disconnect . , . Country X, .
, , TextBox SQL.

.
14. V
, 6.32.
6.32
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button7.Click
Dim cmd As SqlServerCe.SqlCeCommand
cmd = New SqlServerCe.SqlCeCommand("UPDATE Customers SET CompanyName_
= ?, ContactName = ?, City = ?, Country = ?, Phone=?, FAX = ? WHERE_
CustomerID = ?", dbc)
cmd.Parameters.Add("@a", SqlDbType.NVarChar, 40)
cmd.Parameters.Add("@b", SqlDbType.NVarChar, 30)
cmd.Parameters.Add("@c", SqlDbType.NVarChar, 15)
cmd.Parameters.Add("@d", SqlDbType.NVarChar, 15)
cmd.Parameters.Add("@e", SqlDbType.NVarChar, 24)

VB.NET Compact Framework

265

cmd.Parameters.Add("@f", SqlDbType.NVarChar, 25)


cmd.Parameters.Add("@g", SqlDbType.NChar, 5)
cmd.Parameters.Item("@a").Value = TextBox5.Text
cmd.Parameters.Item("@b").Value = TextBox6.Text
cmd.Parameters.Item("@c").Value = TextBox7.Text
cmd.Parameters.Item("@d").Value = TextBox8.Text
cmd.Parameters.Item("@e").Value = TextBox9.Text
cmd.Parameters.Item("@f").Value = TextBox10.Text
cmd.Parameters.Item("@g").Value = TextBox4.Text
If dbc.State = ConnectionState.Closed Then
dbc.Open()
End If
cmd.ExecuteNonQuery()
End Sub

,
. , SQL Server CE , . SQL , .

, , , , ,
System.Data.SqlServerCe.
, .
, . 6.26.
6.26. ,

BindingContext

, ,

DataBindings

DataSource

DisplayMember

ValueMember

, LookUp-

BindingContext DataBindings ,
DataSource, DisplayMember ValueMember ListBox ComboBox, .
DataSource DataGrid.
BindingContext,
. 6.27 6.28.
DataBindings. . 6.29 6.30.

266

6. .NET Compact Framework

6.27. BindingContext

Count

Position

6.28. BindingContext

CancelCurrentEdit

EndCurrentEdit

6.29. DataBindings

Add

Clear

CopyTo

Remove

RemoveAt

6.30. DataBindings

Count

IsReadOnly

IsSynchronized

Item

BindingContext DataBindings
.
. DataBindings , , . , , .
,
ListBox, ComboBox DataGrid.

6.5
1. VB .NET Pocket PC myDB.
2. Button, DataGrid, ListBox ComboBox ,
. 6.26.

VB.NET Compact Framework

267

. 6.26.

3. , 6.33.
6.33
Dim dbc As SqlServerCe.SqlCeConnection
Dim dbcmq As SqlServerCe.SqlCeCommand = New _ SqlServerCe.SqlCeCommand("SELECT * FROM
Customers")
Dim dba As SqlServerCe.SqlCeDataAdapter
Dim dbt As DataTable

4. , 6.34.
6.34
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Cursor.Current = Cursors.WaitCursor
dbc = New SqlServerCe.SqlCeConnection
dbc.ConnectionString = "Data Source=\NorthwindDemo.sdf"
dbt = New DataTable("Customers")
dbcmq.Connection = dbc
dba = New SqlServerCe.SqlCeDataAdapter(dbcmq)
dba.Fill(dbt)
DataGrid1.Visible = False
DataGrid1.DataSource = dbt
DataGrid1.Visible = True
ListBox1.Visible = False
ListBox1.DataSource = dbt
ListBox1.DisplayMember = "ContactName"
ListBox1.ValueMember = "CustomerID"
ListBox1.Visible = True
ComboBox1.Visible = False
ComboBox1.DataSource = dbt
ComboBox1.DisplayMember = "ContactName"
ComboBox1.ValueMember = "ContactTitle"
ComboBox1.Visible = True
Cursor.Current = Cursors.Default

268

6. .NET Compact Framework

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
dbc.Close()
dbt.Clear()
Me.DataBindings.Clear()
End Sub


. , ,
.
.
, , , .


, VB .NET .
Connect, , 6.35.
6.35
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Cursor.Current = Cursors.WaitCursor
dbc = New SqlServerCe.SqlCeConnection
dbt = New DataTable("Customers")
dbcmq.Connection = dbc
dba = New SqlServerCe.SqlCeDataAdapter(dbcmq)
Try
dbc.ConnectionString = "Data Source=\Documents\NorthwindDemo.sdf"
dba.Fill(dbt)
Catch ex As SqlServerCe.SqlCeException
MsgBox(ex.Message)
MsgBox(" , ")
dbc.ConnectionString = "Data Source=\NorthwindDemo.sdf"
Finally
dba.Fill(dbt)
End Try
DataGrid1.Visible = False

Try\Catch\Finally\End
Try. Try .
, . Catch . ex.
. Message ,
InnerException , GetBaseException
, .
Finally ,
, .
End Try .

VB.NET Compact Framework

269

, Exception, . , , SqlServerCe.SqlCeException,
. , Errors, HResult,
NativeError Source ,
. , , Catch
, , . , Catch , , .
Catch ex As SqlServerCe.SqlCeException
' , SQLCE
Catch ex As Exception
'


.NET CF
. . , .
.NET CF , , . 6.31.
6.31. .NET CF

CreateGraphics

OnPaint

Control

DataGrid

Form

Panel

PictureBox

-,
(
OnPaint), CreateGraphics.
,
, , Dispose.

6.6
1. VB .NET Pocket PC myGraph.
2. ,
6.36.

270

6. .NET Compact Framework

6.36
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim br As New Drawing.SolidBrush(Drawing.Color.Red)
Dim g As Graphics = Me.CreateGraphics()
g.FillEllipse(br, 10, 30, 200, 200)
MsgBox("")
g.Dispose()
br.Dispose()
End Sub

,
, ,
.
3. . 6.27.

. 6.27.

4. , , ,
, , OnPaint. ,
6.37.
6.37
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim br As New Drawing.SolidBrush(Drawing.Color.Red)
g.FillEllipse(Br, 20, 40, 200, 200)
br.Dispose()
End Sub

VB.NET Compact Framework

271

, . ,
, .
5. ? , Paint. Paint, 6.38.
6.38
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
Dim gPan As Graphics = e.Graphics
Dim br As New Drawing.SolidBrush(Drawing.Color.White)
Panel1.BackColor = Drawing.Color.Black
gPan.FillEllipse(br, 75, 10, 40, 40)
br.Dispose()
End Sub

6. . 6.28.

. 6.28. Paint

,
Paint CreateGraphics (
), .
Paint.
PictureBox.
System.Drawing.Graphics
System.Drawing. . . 6.32.

272

6. .NET Compact Framework

Graphics System.Drawing ,
, , . , .
6.32. Graphics

Clear

DrawIcon

(icon) . , . , , DrawIcon,
, , ,

DrawImage

FillRegion

. ,

DrawEllipse

DrawLine

DrawPolygon

DrawRectangle

FillEllipse

FillPolygon

FillRectangle

DrawString

MeasureString

System.Drawing.
n Bitmap .
n Brush , .
n Color .
n Font .
n FontFamily , .
n Icon .
n Image , .
n Pen .
n Region , .
n SolidBrush .NET CF.
n SystemColors .

VB.NET Compact Framework

273

6.6 ()
7. Project4Add New Item4Icon File, my.ico
OK.
8. Solution Explorer my.ico
, . 6.29.

. 6.29.

9. Paint.
10. , 6.39.
6.39
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim br As New Drawing.SolidBrush(Drawing.Color.Red)
Dim g As Graphics = Me.CreateGraphics()
Dim rg1, rg2 As Drawing.Region
rg1 = New Drawing.Region(New Drawing.Rectangle(0, 0, 240, 110))
rg2 = New Drawing.Region(New Drawing.Rectangle(100, 50, 40, 100))
rg1.Xor(rg2)
g.Clip = rg1
g.FillEllipse(br, 20, 40, 200, 200)
Dim pathStr As String = IO.Path.GetDirectoryName( _
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
Dim fs As IO.FileStream = New IO.FileStream( _
pathStr + "\My.ico", IO.FileMode.Open)
Dim ico As New Drawing.Icon(fs)
g.DrawIcon(ico, 105, 120)
g.Dispose()
br.Dispose()
ico.Dispose()
fs.Close()
End Sub

11. .
, 6.30.

274

6. .NET Compact Framework

,
. , ,
Graphics. rg1.Xor(rg2) Xor Complement, Exclude Intersect.
.

. 6.30.

, .NET CF , . Microsoft VB .NET.


, ,
C# . , , ,
VB .NET C#.



,
, CDROM, . (, , ),
, , .
n http://www.pocketgear.com
n http://www.hpc.ru
n http://www.ladoshki.com
n http://www.freewareppc.com
n http://www.pocketpcsoft.net


Pocket PC
Basic4PPC
,
. Anywhere Software.
www.pocketgear.com.
Basic4PPC Basic Microsoft Visual Basic. .NET CF.
. COM ActiveX, ,
Windows CE -

276

7.

. , , , .
.
n Run-time Basic4ppc_Runner .
n Basic4ppc Pocket PC.
n Basic4ppcDesktop .
Run-time . Pocket PC .
10 .
, .
. . , www.pocketgear.com
18 , .
( )
, Pocket PC, .
, . 7.1.

. 7.1. Basic4ppc

Pocket PC . 7.2.

Pocket PC

277

. 7.2. Basic4ppc Pocket PC

, . . ,
. - - .

NSBasic
www.nsbasic.com/ce.
. , 30 . , , -, ,
. 7.3.

. 7.3. -

- 8.5 . 150
300 , , .

278

7.

Microsoft, NSBasic .
, Pocket PC.
eVB, . ,
(. 7.4).

. 7.4.

, .
, .
, toolbar .
, eVB, .
, .
, , ,
. , , ,
Windows Mobile Developer Power Toys.
, .
, Tech Notes.

Pocket PC

279

Pocket PC. ,
.

Pelles C
,
. Pelles C Microsoft Windows Pocket PC C.
Pelles C ,
www.smorgasbordet.com/pellesc. 14 . . setup.exe setupsdk.exe,
Program Files bin.zip, crt.zip, win.zip wizwiz.zip.
Pelles C ,
, . , eVC (. 7.5).

. 7.5. Pelles C

280

7.

. . 7.6.
.

. 7.6.

. 7.7.

Pocket PC

281

Pelles C
, (. 7.7).
, , Microsoft Windows.
Pocket PC ,
.
Pocket PC
(. 7.8). SDK Pocket PC , SDK.
Pocket PC .
Copy to Pocket PC, . , .
eVC, Pelles C ARM-. Add-In SDK Project Wizard API
.
,
. ,
.

. 7.8. Pocket PC

PPL
Pocket Programming Language ,
Pocket PC Microsoft Windows.
PPL , - , C. ,
Pascal Basic.
ppl.arwen.com.
, 4,5 .
IDE ,

(. 7.9).
(. 7.10).

282

7.

. 7.9. PPL

. 7.10. PPL

Pocket PC

283

. . ( .ppl) ( .ppc) .
. exe-, . , .
PPL ( variant), .
. , ,
.
.
n .
n .
n .
n .
n , , , .
n .
n WinAPI.
, Pocket PC ( . 7.11
). , ,
, .

. 7.11. PPL

284

7.

Borland Delphi 2005


, , ,
Borland. .NET CF Delphi ,
, Borland.
. preview- .NET CF,
Borland , Pocket
PC Delphi 2005. , .
BDN (bdn.borland.com/ article/
0,1410,33066,00.html),
, , .
, , Delphi
, ,
( , , ), Delphi 2005 , .
. ,
-
.

On-Board

Pocket ViC

Vi C.
.
. , ViC, . Pocket PC ARM (vicarm110.exe)
MIPS (vimips.exe).
Vi (. 7.12).
linux- ,
. , . !
readme.txt vi editing keystrokes. , `+o `+i.
.

On-Board

285

, IDE.
. Unix-,
, .

. 7.12. Vi

, ,
C, ,
Unix-.
, , , Vi,
Pocket PC.

Python
,
. - , Python ,
. Python
. .
n -.
n .
n ( API
).
n ( API C C++).
n .

286

7.

Python ,
. Python Pocket PC www.
murkworks.com.
. .
n ,
Program Files Windows.
n Pocket PC.
n \Windows\Start Menu, Pocket PC Python.exe.
Python (. 7.13).

. 7.13. Python

2+3, Enter. . ,
, www.python.ru
Python, . , . . . , . . .

Scheme
. , scheme ( Lisp) . Pocket Sheme, Pocket Python,
Pocket PC, ,
.

On-Board

287

www.mazama.net/scheme/pscheme.htm.
Download cab-,
Pocket PC .
\Program Files\Pocket Scheme
pscheme.exe pscmedit.exe. pscheme.exe sheme
(. 7.14).

. 7.14. sheme

pscmedit.exe scheme- .
scheme, , , - ,
, . sheme, , www.shounen.ru/docs/guile-ref.
, www.schemers.org.

DSForth
.
, ,
, .
. ,
, .
, ,
- .

288

7.

Pocket PC www.delosoft.com.
ds2.ARM.CAB, .
.
.
1. \Program Files\Dsforth dsforth2.exe.
( OK),
, . . ,
, ,
Forth .
2. dsforth2.exe , Dsforth ds2c.exe.
, , Forth.
Forth (. 7.15).

. 7.15. Forth

, Forth , , , .
www.forth.org.ru,
. Pocket PC ds2c.str. . , ,
, , . ,
www.forth.org/tutorials.html.

On-Board

289

, .
,
www.forth.org.ru .

www.rainer-keuchel.de
,
Pocket PC GNU (
). , ( ) , ( ).
, ,
, www.rainer-keuchel.de/wince/dirlist.html,
www.wince-devel.org/wince/dirlist.html.
celib cedialogs. ,
.
,
Pocket PC.
celib cedialogs
cedialogs-1.05-all-platforms.tar.gz, celib-3.13-dll-bin-allplatforms.tar.gz . WinZip.
\Windows Pocket PC celib.dll
wince-arm-pocket-wce300-release cedialogs.dll cedialogsx.dll wince-arm-pocket-wce300.
Desktop tools
wince-desktop-tools.tar.gz.
, , Windows. Windows. 4, cmd Enter.
.
n cecopy.exe Pocket PC . : cecopy.exe <> <>.
cecopy.exe ce:\Windows\Alarm1.wav pc:c:\ Alarm1.wav
Windows Pocket PC C: .
n cedel.exe Pocket PC. : cedel.exe <_>. cedel.exe 1.txt
1.txt Pocket PC.
n cedir
Pocket PC.
: cedir [-l] <_>. l .
cedir -l \Temp\ Temp.
\.

290

7.

n ceexec.exe .
: ceexec.exe <_> <__>]. ceexec.exe
\Windows\calc.exe Pocket PC.
n cegetinfo.exe .
n cemkdir.exe Pocket PC. : cemkdir.exe
<_>. cemkdir.exe \MyTmp MyTmp
Pocket PC.
n cereg.exe Pocket PC.
: cereg -k <_> -n <> -v <>. cereg
-k HKLM\Environment -n PATH -v \MyProg\bin HKLM\
Environment PATH \MyProg\bin.
cereg.exe .
celib.dll . cereg.exe
, ,
cereg.exe . 7.1.
7.1
@echo
cereg
cereg
cereg
cereg
cereg
cereg
cereg
cereg
cereg
cereg
cereg
cereg
cereg
cereg

off
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment
-k HKLM\Environment

-n
-n
-n
-n
-n
-n
-n
-n
-n
-n
-n
-n
-n
-n

COMPUTERNAME -v Pocket
EMACSDATA -v "\Storage Card\emacs\etc"
EMACSDIR -v "\Storage Card\emacs"
EMACSDOC -v "\Storage Card\emacs\etc"
EMACSLOADPATH -v "\Storage Card\emacs\lisp"
EMACSPATH -v "\Storage Card\emacs\bin"
HOME -v "\Storage Card\Volkov"
PATH -v "\Storage Card\bin"
SHELL -v cmd
TEMP -v \Temp
TMP -v \Temp
TMPDIR -v \Temp
USERNAME -v Volkov
UNIXROOTDIR -v "\Storage Card"

myreg.bat , cereg.exe.
. . .

, ,
. Storage Card, .

ED
editor-wince-arm-pocket-wce300.tar.gz, , editor.exe
\Storage Card\bin Pocket PC. . (. 7.16).

On-Board

291

. 7.16. ED

EMACS LISP
emacs-wince-all-platforms.tar.gz emacs-wince-armxbuild-2.03.tar.gz. emacs, etc, home emacs-winceall-platforms \Storage Card . emacs.exe emacs-wincearm-xbuild-2.03 \Storage Card\emacs\bin .
,
(. 7.17).

. 7.17. Emacs

292

7.

,
Windows. Pocket PC Unix-. , ,
http://www.linux.org.ru/books/GNU/emacs/emacs_toc.html.
, Emacs ,
Emacs LISP. http://www.gnu.org/software/emacs/emacs-lispintro/html_mono/emacs-lisp-intro.html.
Perl
Perl - .
, Perl
, , .
perl-wince-arm-pocket-wce300.tar.gz, .
n perl.exe \Storage Card\bin<$]interface> .

n perl56.dll \Windows .
n lib \Storage Card\usr .
, 7.2.
7.2
@echo off
set perlexe="\Storage Card\bin\perl.exe"
set perllib="\Storage Card\usr\lib\perl5"
cereg -k "HKLM\Environment" -n "PERL5LIB" -v "%perllib%"
cereg -k "HKCR\.pl" -n "" -v "perlfile"
cereg -k "HKCR\perlfile" -n "" -v "Perl Script"
cereg -k "HKCR\perlfile\DefaultIcon" -n "" -v "%perlexe%,-1"
cereg -k "HKCR\perlfile\Shell\open\command" -n "" -v "%perlexe% %%1"

perlreg.bat ,
cereg.exe, .
Pocket PC ED. me.pl,
7.3.
7.3
#! \bin\perl
$me = 5;
print $me;

. (cmd.exe Windows), cd \Storage Card\bin, perl me.pl.


Pocket PC, perlstdout.txt. 5, .
www.perl.org.ru/documentation
Perl.

On-Board

293

Kaffe
, . , . Kaffe Java-, Java.
kaffe-common.tar.gz kaffe-wince-arm-hpc-wce300.tar.gz, \kaffe-common\kaffe \kaffe-wincearm-hpc-wce300\kaffe kaffe, .
, 7.4.
7.4
@echo off
set kaffedir_f=\kaffe
set kaffedir_b=\kaffe
set kaffexe=\kaffe\kaff.exe
cereg -k "HKLM\Environment" -n "KAFFEHOME" -v "%kaffedir_f%"
cereg -k "HKLM\Environment" -n "KAFFELIBRARYPATH" -v "%kaffedir_f%"
cereg -k " HKLM\Environment" -n "KAFFECLASSPATH" -v ".; %kaffedir_f%\Klasses.jar"
cereg -k "HKCR\.class" -n "" -v "javaclass"
cereg -k "HKCR\javaclass" -n "" -v "Java Class"

kaffereg.bat ,
cereg.exe, .
. jar-,
. OnBoard- kjc.jar. , java- .
java 1.2 JFC\SWING.
. JDK 1.2.
, 7.5.
7.5
import java.awt.*;
class Main extends Frame {
Main() {
super("Draw Example ");
setBackground(Color.black);
setBounds(20,80,200,200);
show();
}
public void paint(Graphics g) {
Insets insets = this.getInsets();
int x = insets.left, y = insets.top;
int w = getSize().width-insets.left-insets.right;
int h = getSize().height-insets.top-insets.bottom;
g.setColor(Color.red);
while (w > 0 && h > 0) {
g.clearRect(x++, y++, w, h);
g.fillRect(x++, y++, w-2, h-2);
w -= 4;
h -= 4;

294

7.

}
}
static public void main(String[] args) {
new Main();
}
}

Main.java C:. . , C: :
javac main.java

,
javac.exe. PATH , .
, C: Main.class. java-.
Main.class kaffe Pocket PC, cmd.exe .
:
kaff \kaffe\Main

Main.class . . 7.18.

. 7.18. Java- Pocket PC

. Java Pocket PC. www.rainer-keuchel.de


kaffe ,
Java 2.

Java

295

PGCC
On-Board \++ Pocket PC.
, . .
.
:
n pgcc.ARM.CAB .
n cmd.arm.cab Microsoft.
n pocketconsole.arm.cab SymbolicTools.
Pocket PC .
pgcc, ,
. Pocket
PC SDK PGCC. , \pgcc\samp, menu.bat. ,
\pgcc\samp\menu menu.exe.
,
.
menu.bat, , .
C++ www.opennet.ru/docs/RUS/gcc. ,
http://groups.yahoo.com/group/pocketgcc/. ,

pgcc, , , .

Java
Java-, Java- Pocket PC.

Mysaifu JVM
, . www2s.biglobe.ne.jp/~dat/java/project/jvm/index_en.html.
jvm.ARM.CAB Pocket PC.
\Program Files\Mysaifu JVM\jre\bin jvm.exe . (. 7.19).
(.jar) (.class).
\My Documents ,
Advanced, Classpath .
. 7.20 ImageViewer.

296

7.

. 7.19. Mysaifu JVM

. 7.20. JVM
ImageViewer

, kaffe
( Main) - JDK 1.3. .jar , .
JVM ,
Pocket PC. , , Pocket PC, ,
(. 7.21).

. 7.21. Stylepad, JVM

Java

297

Mysaifu JVM Java-,


Pocket PC Borland Java Builder Net Beans ( SUN).

Weme
Java-MIDLET Pocket PC IBM.
Java-,
.
Weme IBM, , www-306.ibm.com/software/wireless/wctme/bundle.html.
42 . weme-wm2003-arm-ppro10-5.7.2-P-20050304-1743.exe.
, . (JDK, ),
Pocket PC.
( ,
IBM, ) . .jar .jad
Pocket PC. ,
midlets .
, . . 7.22 , Dwindle.

. 7.22. Dwindle, Weme

298

7.

, www-306.ibm.com/software/wireless/weme/.

CrEme
. 30 .
. , Mysaifu
JVM, CrEme Java (
Demo JDK 1.3 swing/JPanel),
. , Java- , .
(. 7.23).
www.nsicom.com. , . CrE-ME400b8_ARM_CE42_PPC.exe,
Windows.
Java- ( Products4Dowload):
n CrEme 3.26 Personal Java 1.1.8.
n CrE-ME 4.0 Beta J2ME CDC 1.0.

. 7.23. , CrEme

Jeode
www.insignia.com.
Java- CrEme, , ,
Personal Java 1.2.

Java

299

. . .

SuperWaba
- Java- Pocket PC java- . SuperWaba
PDA. SuperWaba Waba WM (www.wabasoft.com)
.
www.superwaba.com.br/en/default.asp.
SDK ,
.
GPL_SuperWabaSDK.exe GPL_
SuperWabaSDK_Installs.exe, . GPL_SuperWabaSDK_
Installs\bin\installers\vm\ce _CEinstall-RunMe.bat.
Pocket PC.

Storage Card. , , SuperWaba


.

Pocket PC SuperWaba VM.


. 7.24.

. 7.24. SuperWaba

300

7.

,
. .
\GPL_SuperWabaSDK_Installs\bin\installers\samples\ce , .
Pocket PC
. .
SuperWaba.
SuperWaba ,
Java.
, SuperWaba Java, Java
SuperWaba, SuperWaba Java. ,
SuperWaba Java c , SuperWaba Java, ,
SuperWaba.
, , Java, SuperWaba, , ,
.

Ewe
SuperWaba, Ewe Waba VM.
Ewe SuperWaba ,
Ewe . ,
www.ewesoft.com.
Ewe
. Ewe
API, . Ewe SuperWaba, . , Ewe .
Ewe,
Ewe VM, Java VM,
Pocket PC Ewe VM Pocket PC Java VM. Java
Ewe VM.
, Ewe, Pocket PC ,
, Java Pocket PC
Java-. Ewe VM.
Ewe Pocket PC,
( Downloads) ,
.

Java

301

n Ewe148-Installer-Win32.zip Ewe Windows. Windows. Ewe .


n Ewe148-CAB-PocketPC2003.zip ( Pocket PC 2003), PocketPC2003-HighResolution.zip
( Pocket PC 2003 SE), Ewe148-CAB-PocketPC.zip ( Pocket PC 2002)
cab-,
.
n Ewe148-JavaVM.zip , Ewe Java-.
n Ewe148-Emulator-CAB.zip Ewe Pocket PC,
Pocket PC 2003, SmartPhone 2002, SmartPhone 2003, CE. Net Standard SDK.
.
n Ewe148-Developer-SDK.zip SDK Ewe.
.
n Ewe148-Developer-API.zip Ewe API.
n Ewe148-Developer-Guide.zip .
n Ewe148-Developer-Samples.zip .
n Ewe148-Developer-InstallerSDK.zip SDK Ewe,
Ewe.
Pocket PC,
ewe.exe. Pocket PC /Ewe.
, Ewe
.
-,
. 7.25.
. 7.26.
(. . 7.27).
, . 7.28.
, Ewe,
Java,
Ewe, , Java.
, , Java Ewe. java- Java Ewe- Jewel (. 7.29).

302

7.

. 7.25. - Ewe

. 7.27. Ewe

. 7.26. Ewe

. 7.28. Ewe

Jewel Java- Pocket PC,


.ewe.

Java

303

. 7.29. Ewe- Jewel

Ewe Pocket PC. SuperWaba Ewe, Ewe.

, . , , eVB , CE API
. ,
,
, . , eVB
. Visual Basic
. , ,
.
, , . , . eVB.

.
.
.
.
.
.
. , .

, 194044, -, . ., 29.
05784 07.09.01.
005-93, 2; 95 3005 .
26.01.06. 70100/16. . . . 24,51. 3000.
. . .
.
197110, -, ., 15.