Foreword |
|
xv | |
Introduction |
|
xvii | |
Part I Introduction to Upgrading |
|
|
Visual Basic .NET Is More Than Visual Basic 6 + 1 |
|
|
3 | (16) |
|
|
6 | (2) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
8 | (2) |
|
Expect Subtle Differences |
|
|
8 | (1) |
|
Plan for a 95 Percent Automated Upgrade |
|
|
9 | (1) |
|
|
10 | (8) |
|
|
10 | (4) |
|
|
14 | (1) |
|
New Web Development Features |
|
|
15 | (1) |
|
Better Development Environment |
|
|
15 | (1) |
|
Is Visual Basic Still the Best Choice for Visual Basic Developers? |
|
|
16 | (2) |
|
|
18 | (1) |
|
Visual Basic 6 and Visual Basic .NET: Differences |
|
|
19 | (26) |
|
.NET Framework vs. ActiveX |
|
|
19 | (10) |
|
|
21 | (1) |
|
|
22 | (3) |
|
|
25 | (4) |
|
|
29 | (1) |
|
Differences in the Development Environment |
|
|
29 | (5) |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
32 | (1) |
|
|
33 | (1) |
|
|
34 | (1) |
|
A Single Standard for Windows Forms |
|
|
34 | (1) |
|
Two Forms Packages for the Price of One |
|
|
35 | (1) |
|
|
35 | (7) |
|
All Subroutine Calls Must Have Parentheses |
|
|
37 | (1) |
|
ByVal or ByRef Is Required |
|
|
38 | (1) |
|
|
38 | (1) |
|
Arrays Must Have a Zero-Bound Lower Dimension |
|
|
39 | (1) |
|
Fixed-Length Strings Are Not Supported |
|
|
40 | (1) |
|
Variant Data Type Is Eliminated |
|
|
40 | (1) |
|
Visibility of Variables Declared in Nested Scopes Is Limited |
|
|
41 | (1) |
|
|
42 | (1) |
|
|
42 | (1) |
|
Cannot Continue After an Error |
|
|
42 | (1) |
|
No Repainting in Break Mode |
|
|
42 | (1) |
|
|
43 | (2) |
|
|
45 | (16) |
|
|
45 | (3) |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
47 | (1) |
|
Upgrade with Interoperability |
|
|
47 | (1) |
|
Role of the Upgrade Wizard |
|
|
48 | (1) |
|
|
48 | (1) |
|
|
49 | (1) |
|
Upgrading from Earlier Versions of Visual Basic |
|
|
49 | (1) |
|
Selecting Projects to Upgrade |
|
|
50 | (8) |
|
|
51 | (4) |
|
Evaluating the Effort Required |
|
|
55 | (3) |
|
Developing the Upgrade Plan |
|
|
58 | (1) |
|
|
59 | (2) |
|
Preparing Your Project for the Upgrade to Visual Basic .NET |
|
|
61 | (18) |
|
|
61 | (1) |
|
|
62 | (2) |
|
VarPtr, Deflnt, and Other No-Shows |
|
|
62 | (1) |
|
|
63 | (1) |
|
Good Visual Basic 6 Coding Practices |
|
|
64 | (12) |
|
|
64 | (2) |
|
|
66 | (3) |
|
Early Binding vs. Late Binding vs. Soft Binding |
|
|
69 | (4) |
|
Watch Out for Null and Empty |
|
|
73 | (1) |
|
Implicit Object Instantiation |
|
|
74 | (2) |
|
|
76 | (3) |
Part II Upgrading Applications |
|
|
|
79 | (22) |
|
|
79 | (15) |
|
|
85 | (3) |
|
|
88 | (4) |
|
Other Files in Your Project |
|
|
92 | (2) |
|
|
94 | (4) |
|
Using the VB Snippet Upgrade Add-In |
|
|
98 | (1) |
|
Upgrading Using the Command Line |
|
|
99 | (1) |
|
|
100 | (1) |
|
Common Tasks in Visual Basic .NET |
|
|
101 | (16) |
|
A Guide to Working in Visual Basic .NET |
|
|
101 | (7) |
|
Creating a Visual Basic .NET Project |
|
|
102 | (2) |
|
Getting to Know the Visual Studio .NET IDE |
|
|
104 | (2) |
|
|
106 | (1) |
|
A Quick Introduction to Debugging |
|
|
107 | (1) |
|
|
108 | (4) |
|
|
108 | (1) |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
111 | (1) |
|
Problem-Solving Techniques |
|
|
112 | (3) |
|
Using the System.Diagnostics Library |
|
|
112 | (1) |
|
|
113 | (1) |
|
Simplifying Complex Expressions |
|
|
114 | (1) |
|
|
115 | (2) |
|
Upgrade Wizard Ins and Outs |
|
|
117 | (32) |
|
|
117 | (2) |
|
|
117 | (1) |
|
|
118 | (1) |
|
|
119 | (1) |
|
Upgrade Wizard Capabilities and Limitations |
|
|
119 | (1) |
|
|
119 | (29) |
|
|
121 | (7) |
|
Forms and Intrinsic Controls |
|
|
128 | (9) |
|
ActiveX Controls and ActiveX References |
|
|
137 | (3) |
|
|
140 | (5) |
|
|
145 | (1) |
|
Class Modules and User Controls |
|
|
145 | (1) |
|
Objects for Accessing Data |
|
|
146 | (1) |
|
|
147 | (1) |
|
|
148 | (1) |
|
Errors, Warnings, and Issues |
|
|
149 | (26) |
|
The Different Kinds of EWIs |
|
|
152 | (3) |
|
|
152 | (1) |
|
|
153 | (1) |
|
|
154 | (1) |
|
|
154 | (1) |
|
Upgrade Notes and Global Warnings |
|
|
155 | (1) |
|
Understanding the Upgrade Report |
|
|
155 | (4) |
|
|
157 | (2) |
|
|
159 | (1) |
|
The Different Upgrade EWIs |
|
|
160 | (12) |
|
|
160 | (3) |
|
|
163 | (1) |
|
|
164 | (3) |
|
|
167 | (2) |
|
|
169 | (1) |
|
|
170 | (2) |
|
Which Problems Are Not Detected? |
|
|
172 | (2) |
|
|
174 | (1) |
|
Using Visual Basic 6 with Visual Basic .NET: COM Interop |
|
|
175 | (24) |
|
Where COM Interop Comes into Play |
|
|
177 | (1) |
|
|
177 | (1) |
|
Communication Between a .NET Client and a COM Server Component |
|
|
177 | (1) |
|
Communication Between a COM Client and a .NET Server Component |
|
|
178 | (1) |
|
Upgrading a Visual Basic 6 Client/Server Application |
|
|
178 | (11) |
|
Creating a .NET Client That Talks to a COM Server |
|
|
180 | (2) |
|
Debugging Between the Visual Basic .NET Client and Visual Basic 6 Server |
|
|
182 | (2) |
|
Exposing a Visual Basic .NET Component to Be Called by a Visual Basic 6 Client |
|
|
184 | (3) |
|
Debugging Between the Visual Basic 6 Client and .NET Server |
|
|
187 | (1) |
|
|
188 | (1) |
|
Replacing COM with .NET: Binary Compatibility |
|
|
189 | (7) |
|
Indirect Replacement Model |
|
|
190 | (1) |
|
Enabling Binary Compatibility in Visual Basic .NET Classes |
|
|
191 | (5) |
|
|
196 | (3) |
Part III Getting Your Project Working |
|
|
Ten Common Upgrade Problems |
|
|
199 | (24) |
|
|
199 | (2) |
|
Addltem and ToString with COM Objects |
|
|
201 | (2) |
|
Deterministic Finalization and Garbage Collection |
|
|
203 | (3) |
|
Bringing a Little Determinism to the Party |
|
|
205 | (1) |
|
Generic Objects (Control/Form/Screen) |
|
|
206 | (1) |
|
|
207 | (1) |
|
Sub Main (or Default Form) |
|
|
208 | (1) |
|
|
209 | (3) |
|
|
212 | (1) |
|
|
213 | (6) |
|
Drag and Drop in Visual Basic 6 |
|
|
213 | (2) |
|
Drag and Drop in Visual Basic .NET |
|
|
215 | (4) |
|
|
219 | (3) |
|
|
222 | (1) |
|
Resolving Issues with Language |
|
|
223 | (42) |
|
|
224 | (14) |
|
#If...#End If Precompiler Statements |
|
|
224 | (1) |
|
Constants and Constant Expressions |
|
|
224 | (3) |
|
|
227 | (5) |
|
|
232 | (6) |
|
Types and Type Operations |
|
|
238 | (11) |
|
|
238 | (4) |
|
|
242 | (3) |
|
|
245 | (4) |
|
Making Your Code Thread-Safe |
|
|
249 | (2) |
|
|
251 | (12) |
|
|
252 | (1) |
|
As Any No Longer Supported |
|
|
253 | (1) |
|
|
254 | (4) |
|
Passing User-Defined Types to API Functions |
|
|
258 | (3) |
|
ObjPtr and StrPtr Not Supported |
|
|
261 | (2) |
|
|
263 | (2) |
|
Resolving Issues with Forms |
|
|
265 | (20) |
|
Similarities in Form Structure |
|
|
265 | (2) |
|
|
267 | (7) |
|
Differences in Properties, Methods, and Events |
|
|
267 | (2) |
|
|
269 | (5) |
|
|
274 | (9) |
|
|
274 | (3) |
|
The Default Form: Deflnstance |
|
|
277 | (1) |
|
Application Lifetime and Forms |
|
|
278 | (4) |
|
|
282 | (1) |
|
|
283 | (2) |
|
Upgrading ActiveX Controls and Components |
|
|
285 | (20) |
|
ActiveX Controls are Still Supported-Yes! |
|
|
285 | (1) |
|
|
286 | (1) |
|
Limitations of ActiveX Control Hosting |
|
|
286 | (3) |
|
ActiveX .NET Controls: Best of Both Worlds |
|
|
289 | (4) |
|
ActiveX Interop Ax Wrapper: The Windows Forms Wrapper |
|
|
289 | (1) |
|
Property and Parameter Type Mappings |
|
|
290 | (3) |
|
Standard Component Wrappers and ActiveX Control Subobjects |
|
|
293 | (4) |
|
Common Exceptions That Require Type Conversions |
|
|
295 | (2) |
|
|
297 | (1) |
|
|
297 | (1) |
|
Using ActiveX Components from .NET |
|
|
298 | (5) |
|
|
298 | (1) |
|
When a Collection Is Not a Collection |
|
|
299 | (2) |
|
|
301 | (1) |
|
Alias Types Are Not Supported |
|
|
301 | (1) |
|
Module Methods Are Not Supported |
|
|
302 | (1) |
|
|
303 | (2) |
|
Resolving Data Access Issues |
|
|
305 | (18) |
|
Data Access in Visual Basic |
|
|
306 | (3) |
|
|
306 | (1) |
|
|
307 | (1) |
|
|
307 | (1) |
|
Components That Don't Upgrade |
|
|
308 | (1) |
|
|
309 | (1) |
|
General Issues with Data Access Code |
|
|
309 | (6) |
|
DAO and RDO Module Methods |
|
|
309 | (2) |
|
|
311 | (1) |
|
|
311 | (2) |
|
|
313 | (1) |
|
Null, vbNullString, and vbNullChar |
|
|
314 | (1) |
|
|
315 | (1) |
|
|
315 | (1) |
|
|
316 | (1) |
|
Cursor Location with Microsoft Access Databases |
|
|
316 | (1) |
|
|
316 | (5) |
|
Control Arrays of ADO Data Controls |
|
|
318 | (1) |
|
Setting Data Binding Properties at Run Time |
|
|
318 | (3) |
|
|
321 | (2) |
|
Problems That Require Redesign |
|
|
323 | (24) |
|
Replacing the OLE Container Control |
|
|
323 | (5) |
|
Replacing Painting Functions |
|
|
328 | (3) |
|
|
331 | (2) |
|
Using the Controls Collection |
|
|
333 | (2) |
|
Using the Forms Collection |
|
|
335 | (2) |
|
|
337 | (3) |
|
|
340 | (3) |
|
Eliminating ObjPtr, VarPtr, and StrPtr |
|
|
343 | (2) |
|
|
345 | (2) |
|
Upgrading COM+ Components |
|
|
347 | (18) |
|
|
347 | (1) |
|
Using COM+ in Visual Basic .NET |
|
|
348 | (12) |
|
COM+ Requirements in Visual Basic .NET |
|
|
350 | (1) |
|
Inheriting from the ServicedComponent Class |
|
|
351 | (1) |
|
|
352 | (4) |
|
Creating a Strong Name for Your Assembly |
|
|
356 | (2) |
|
Registering COM+ Applications |
|
|
358 | (2) |
|
Upgrading COM+ Components |
|
|
360 | (4) |
|
Making .NET and COM Components Work Together |
|
|
364 | (1) |
|
|
364 | (1) |
|
Upgrading VB Application Wizard Projects |
|
|
365 | (20) |
|
|
367 | (2) |
|
|
369 | (1) |
|
|
370 | (1) |
|
|
370 | (6) |
|
|
370 | (1) |
|
mnuHelpAbout_Click Event Procedure |
|
|
371 | (1) |
|
|
371 | (1) |
|
ActiveMdiChild in MDI Projects |
|
|
372 | (2) |
|
Forms Collection in frmMain_Closed |
|
|
374 | (1) |
|
Clipboard in MDI Projects |
|
|
375 | (1) |
|
|
376 | (2) |
|
|
378 | (1) |
|
|
378 | (1) |
|
|
379 | (2) |
|
|
379 | (2) |
|
|
381 | (4) |
Part IV Techniques for Adding Value |
|
|
Adding Value to Your Applications |
|
|
385 | (18) |
|
Overview of the Sample Application |
|
|
386 | (1) |
|
|
387 | (5) |
|
Reading the Contents of a Directory |
|
|
387 | (1) |
|
Finding All the Forms in a DLL |
|
|
388 | (1) |
|
Loading Forms Dynamically |
|
|
389 | (1) |
|
Reading and Writing to Files |
|
|
389 | (1) |
|
|
390 | (2) |
|
|
392 | (8) |
|
|
392 | (2) |
|
|
394 | (1) |
|
|
394 | (4) |
|
Windows XP-Style Controls |
|
|
398 | (2) |
|
|
400 | (1) |
|
|
401 | (2) |
|
Replacing ActiveX Controls with Windows Forms Controls |
|
|
403 | (14) |
|
Benefits of Upgrading Controls |
|
|
404 | (1) |
|
100 Percent .NET Compatibility |
|
|
404 | (1) |
|
|
404 | (1) |
|
|
405 | (1) |
|
Process of Replacing Controls |
|
|
405 | (7) |
|
Manually Upgrading a Control |
|
|
406 | (6) |
|
Mappings for Visual Basic 6 ActiveX Controls |
|
|
412 | (4) |
|
ActiveX Controls vs. Windows Forms Controls |
|
|
413 | (3) |
|
|
416 | (1) |
|
Moving from ADO to ADO.NET |
|
|
417 | (18) |
|
ADO.NET for the ADO Programmer |
|
|
417 | (4) |
|
|
418 | (1) |
|
|
419 | (2) |
|
Integrating Your ADO Code into a Visual Basic .NET Application |
|
|
421 | (4) |
|
Binding Your ADO Recordset to .NET Controls |
|
|
422 | (1) |
|
Using ADO with XML Web Services |
|
|
423 | (2) |
|
Mapping ADO Objects to ADO.NET |
|
|
425 | (4) |
|
Connection and Command Objects |
|
|
425 | (2) |
|
|
427 | (2) |
|
|
429 | (1) |
|
|
430 | (2) |
|
Binding to Windows Forms Controls |
|
|
430 | (2) |
|
|
432 | (2) |
|
|
434 | (1) |
|
Upgrading Distributed Applications |
|
|
435 | (86) |
|
Important Concepts for Distributed Applications |
|
|
436 | (4) |
|
Loosely Coupled vs. Tightly Coupled Applications |
|
|
436 | (1) |
|
Overhead in Method Invocation |
|
|
437 | (2) |
|
Componentization and Logical Organization |
|
|
439 | (1) |
|
Distributed Technologies in .NET |
|
|
440 | (1) |
|
|
440 | (12) |
|
Creating a Simple XML Web Service |
|
|
441 | (5) |
|
Supporting Web Services in Your Existing Applications |
|
|
446 | (6) |
|
|
452 | (9) |
|
A Simple Remoting Example |
|
|
453 | (3) |
|
Architecture for Remoting |
|
|
456 | (5) |
|
Distributed COM+ Applications |
|
|
461 | (3) |
|
|
461 | (1) |
|
|
461 | (2) |
|
COM+ Application Proxies in .NET |
|
|
463 | (1) |
|
|
464 | (3) |
Part V Appendixes |
|
|
Appendix A Object Mapping Reference |
|
|
467 | (48) |
|
Appendix B Function Mapping Reference |
|
|
515 | (6) |
Index |
|
521 | |