Index by subasheela

VIEWS: 116 PAGES: 28

									521

Index
Symbols and Numbers
<> (angle brackets), 352 += (assignment shortcut), 223 -= (assignment shortcut), 223 . and .. directories, 154 = (operator, testing for Null and Empty), 73 ( ) (parentheses) with function calls, 92 indicating parameters not to be set, 299 required on subroutine calls, 37 95 percent automated upgrade, 9–10 100 percent .NET compatibility, 404 100 percent upgrade, 9 installing with Visual Basic 6 Setup, 80 mappings for, 412–13 no direct .NET replacements for, 286 outside Visual Basic environments, 286 placing on a Visual Basic .NET form, 32 removing dynamically at run time, 334–35 replacing with Windows Forms controls, 403, 405–6 subobjects in, 293 support for, 285–86 Toolbox references to, 31–32 types not supported in the Windows Forms environment, 286–87 upgrade strategy for, 286 upgrading, 137–40 using from .NET, 298–303 in Visual Basic .NET, 177 ActiveX Data Objects. See ADO ActiveX designers, 289 ActiveX DHTML page projects, 48 ActiveX DLL project types, 122, 365, 366 ActiveX DLLs, 249 ActiveX document projects, 48 ActiveX documents, 170 ActiveX EXE project, 272 ActiveX EXE project types, 122 ActiveX libraries, installing, 80 ActiveX MousePointer property, 295–96 ActiveX MSBind object, 137 ActiveX .NET control, 289 ActiveX object types, conversion functions for common, 295 ActiveX portion of an ActiveX .NET control, 289 ActiveX ProgressBar control, 406 ActiveX types, unique identifiers associated with, 28 ActiveX UpDown control. See UpDown control ActiveX vs. .NET framework, 19–29 ActiveX wrapper. See Ax wrapper “Add a delegate for AddressOf” upgrade issue, 163 add-in components for Visual Basic 6, 288–89 Add method calling for a ComboBox or ListBox, 201 calling the ToString method, 202 Add Project from File menu in Visual Basic 6, 94 Add Reference dialog box, 111 Add Web Reference dialog box, 112 AddForm function, 280–81 AddHandler keyword, 36

A
About box form, 369 About menu item, 371 Abs function, 141–42 abstract base class, 36 abstraction, 66–69 Activator class, 455 active form, 373 ActiveConnection properties, 425–26 ActiveForm object, 372–73 ActiveMDIChild, 373–74 ActiveX ADO Data controls. See ADO Data control ActiveX components designing and testing for target environments, 21 reusing in Visual Basic .NET applications, 121 threading of, 29 types not supported in the Windows Forms environment, 286–87 using from .NET, 298–303 ActiveX control library, 412 ActiveX control project type, 122 ActiveX controls adding dynamically at run time, 334 compared to Windows Forms controls, 413–16 copying design-time property settings for, 407–10 creating in Visual Basic 6, 20 deleting from forms, 410 exposing property types to .NET types, 291 extended property settings supported by Visual Basic 6, 408–9 extra DLLs generated for, 405 global use of, 404 hosting, 173, 286–89

521

522

AddItem method with COM objects

AddItem method with COM objects, 201–3 “‘AddressOf’ expression cannot be converted” compiler error, 256–57 AddressOf keyword, 254–57 AddrOfPinnedObject method, 344 ADO (Active Data Objects), 25–26, 63, 417 versions of, 311 with XML Web services, 423–25 ADO-based applications, 146–47 ADO classes, closing out, 449 ADO code integrating into Visual Basic .NET applications, 421–25 manipulating data objects, 306 ADO data binding, 63, 288, 316–17 compared to ADO.NET, 309 upgrade note about, 170 ADO Data control (ADODC), 137, 413 control array of, 318 in place of the Data control, 128 ADO data environment, 307, 315–16 ADO objects, mapping to ADO.NET, 425–29 ADO Recordset. See also Recordsets splitting into DataSet and DataReader classes, 419 substituting SqlDataReader for, 53 ADODB Stream class, 449 ADODB Stream object, 447 ADODC-based data-bound application, 139 ADODC controls. See ADO Data control ADODC1_MoveComplete event, 311 adoHelper helper class, 327 ADO.NET, 309 concepts of, 417–21 consistency with other .NET Framework classes, 418 data access object model, 53, 63 data binding, 63 mapping ADO objects to, 425–29 alias types, 301–2 AlocHGlobal function, 261 alpha blending, 397–98 Alphabetical view in Property Browser, 32 ambiguous types, 27 Anchor property setting for a ListBox control, 105 of the TreeView control, 394 AndAlso keyword, 36 angle brackets (<>), 352 Ansi keyword, 36 ANSI strings, marshaling string parameters as, 259 apartment threading, 29 API Declare statements, 370–71 API functions. See Windows API functions

App object concatenating properties in Visual Basic 6, 367 upgrading properties and methods of, 467–69 App.HelpFile property, 371–72 AppID class, 310 application architecture, 55–57 application form count, decrementing, 280–81 application lifetime, 278 application manifest, 399 application proxies. See COM+ application proxies application proxy file, 348 “Application will terminate when Sub Main() finishes” upgrade warning, 165 Application Wizard projects, 209 ApplicationAccessControl attribute, 353 ApplicationActivation attribute, 353, 462 Application.Exit function, 280, 282 ApplicationID attribute, 353 ApplicationName attribute, 353 ApplicationQueuing attribute, 353 Application.Run function, 280 Application.Run method, 209 applications adding value to upgraded, 385–401 analyzing with the Upgrade Wizard, 49 configuring to run Windows XP-style controls, 398–400 deployment with Windows Forms controls, 405 finishing in Visual Basic 6 and Visual Basic .NET, 165 identifying the main form, 279 integrating ADO code into, 421–25 leaving in Visual Basic 6, 45–46 lifetime of, 208 limitations of upgraded, 400–401 managing the lifetime of, 279–80 preparing for the upgrade process, 61–76 registering manually, 359 stand-alone, 57 startup scenarios for, 209 supporting Web services in existing, 446–51 termination of, 278 testing after Upgrade Wizard modification, 49 upgrade options for, 45–47 upgrade potential of, 148 upgrading distributed, 435–64 upgrading multitiered, 175 upgrading one piece at a time, 188 upgrading partially to Visual Basic .NET, 46–47 App.Major object property, 367, 369 App.Minor object property, 367, 369 App.Revision object property, 367, 368, 369 architecture for remoting, 456–61

ArgumentOutOfRange exception

523

ArgumentOutOfRange exception, 107 Arial font, 210 arithmetic operators, shortcuts for, 12 array bound checks, 127 array declarations, upgrading Visual Basic 6, 243 “Array may need to have individual elements initialized” upgrade warning, 164 array types in Visual Basic .NET, 242 ArrayIsDynamic parameter with FileGet, 236 arrays declaring with As New, 207 defining in compatibility with Visual Basic .NET, 75 initializing, 163, 207–8, 247 listing forms in, 389 lower bounds of, 164 nonzero-bound, 301 ReDim statement with, 164, 236 zero-bound lower dimension, 39–40 “Arrays can’t be declared with New” upgrade warning, 164, 207 “Arrays in structure may need to be initialized” upgrade warning, 164 As Any declarations, 253–54 As Any parameter, 161 As New syntax upgrade issues with, 207–8 in Visual Basic 6, 74, 75 in Visual Basic .NET, 74–76 “As <variable type> was removed from ReDim statement” upgrade warning, 164 AscB function, 142, 160 .asmx file extension, 440 ASP pages, 56 ASP Web applications, 56 ASP.NET debugging applications on a local machine, 184 pages, 53 programming model, 440 Aspnet_wp.exe, 184 .aspx files, 440 assemblies, 389 creating for public interfaces, 456–57 creating strong names for, 356, 357 types contained in, 28 Assembly Name, 122 Assembly.CreateInstance method, 389 AssemblyInfo.vb file, 126–27, 352–53 assembly attributes in, 93 AssemblyVersion attribute, 369 “Assignment not supported: KeyAscii to a non-zero value” upgrade warning, 167 asynchronous call, 206 Atn function, 141–42 attached debugger, 113

attributes, 12, 352–56 adding to declare ID attributes, 191, 193 in AssemblyInfo.vb, 93 attaching to components, 352 scopes of, 355 upgrading Visual Basic 6, 122–27 Auto keyword, 36 AutoComplete attribute, 353, 356, 363 automated upgrade, plan for, 9–10 automatic coercions between types, 17–18 automatic formatting, 18 automatic transaction processing, 349 AutoRedraw property, 329 Ax wrapper, 290 applying to the TreeView control, 293 exposing ActiveX properties, 291 renaming ActiveX properties, 297 Ax wrapper class, 290

B
back-end legacy systems, 57 BackColor property, 20 background compilation, 18 compiler, 16 erasing in GDI+, 331 Task List, 16 bad constants, 212–13 “Bad record length”exception, 237 base class instance, 36 base filenames, upgrading two files with the same, 127 Basic programming language, 223 behavior differences between Visual Basic 6 and Visual Basic .NET, 154 bidirectional data transfers, 420 binary compatibility controlling for upgraded components, 195 enabling in Visual Basic .NET classes, 191–95 ensuring, 187 turning on in a Visual Basic 6 project, 182–83 in Visual Basic 6, 189 binary files, 233–34 binary string functions, 142 binding. See data binding binding collection, 138, 317 bitmap collection editor, 340–41 bitmapCollection property, 340 Break method, 113 break mode, 42–43 breaking compatibility, 6–8, 9 breakpoints, 110 BuddyControl property, 139 build errors, handling, 108–9

524

Build property in Windows

Build property in Windows, 369 Button controls, adding to a Windows Forms project, 104, 105 BYOT (bring your own transaction), 349 ByRef calling convention, 38 keyword, 144 parameters, 172–73, 298–99 ByteArray, assigning to a string, 163 ByVal calling convention, 38 keyword, 144 parameters, 173 ByValArray attribute, 260, 261 ByValTStr attribute, 261

C
C# language, 16–18 C++ .NET, 46 Calendar statement, 160 callback function, 254 Cancel property for Unload, 162 CancelButton property setting, 133 “Cannot determine array type because it is Nothing” exception, 236 “Can’t resolve the name of control” upgrade warning, 164 Caption property, upgrading to Text property, 133, 267 Catch keyword, 37 Category view in Property Browser, 32 CChar keyword, 36 CCW (COM callable wrapper), 178 CD with this book. See companion CD Char array, 260 Char type, 223 Charset parameter with StructLayout, 259 ChDir statement, 232 ChDrive statement, 232 CheckBox control, 128 CheckBox object, 469–71 child nodes, adding to a TreeView control, 414 Chr function, 241 ChrB function, 160 Circle method, 328 class attributes, 145–46 “Class instancing was changed” upgrade warning, 165 Class keyword, 36 class-level Boolean variable, 276 class modules, 145–46 Class statement, 90 class structure of ADO.NET, 418 classes, implementing, 82 ClassesRoot property of the Registry object, 394

Clear method in GDI+, 331 Click event editing, 95–96 reassociating with the ProgressBar control, 411–12 Click procedure, signature of, 90–91 Click statement, 271 client application, required for remoting, 452 client for the Architecting for Remoting sample, 460–61 client process in the Simple Remoting example, 454–56 client projects, 58 client/server applications forms-based, 56–57 upgrading from Visual Basic 6, 178–81 client-side cursor location, 316 client-side technologies, 5 ClientSize property, 133 Clipboard class in the .NET Framework, 268 Clipboard code, rewriting, 331–33 “Clipboard method was not upgraded” upgrade issue, 332, 375 Clipboard object, 268, 331, 375 Clipboard text, helper methods for getting and setting, 375–76 Close method closing registry keys, 394 releasing physical resources, 205 Close statement, 232 closed environments, 21 Cls method, 328 Cls statement, 271 CObj keyword, 36 code behind forms, 144–45 changes in upgraded, 37–41 manipulating data objects, 306–7 preserving during the upgrade process, 118 size and scope as upgrade factors for an application, 58 thread-safe, 249–51 types of conversions, 140–42 upgrading, 120 upgrading Visual Basic 6, 140–45 Code Editor in the AddButton_Click method, 105 “Code was upgraded to use <function> which may not have the same behavior” upgrade issue, 163 coding practices, common problematic, 64–76 coercion functions, 36 mapping with, 141 problems, 172 collapsed code regions, 90 Collect method, 25, 206 collection classes, 170, 219–22 collection enumerator, 163

collections

525

collections, 162, 299–300 color objects, 226 colors, declaring constants as, 170 ColorTranslator.FromOle method, 226 COM, 271–72, 350 COM attributes adding to ensure binary compatibility, 187 specifying, 195 COM-based systems, 423 COM callable wrapper (CCW), 178 COM clients, communicating with .NET server components, 178 COM components applications with a dependency on, 47 creating in Visual Basic 6, 178–79, 189 .NET clients communicating with, 177 with no .NET equivalent, 176 reference counting in, 203–4 removing prior to XCopy deployment, 401 serializing to an intrinsic data type, 446–47 from Visual Basic .NET, 58 “COM expression not supported: Module methods of COM objects” upgrade issue, 161, 303 COM GUIDs, 194 COM interop, 121, 175 compared to COM+ services, 349–50 registering a component for, 186 when to use, 177–78 upgrading applications one piece at a time, 188 in Visual Studio .NET, 176 COM interop layer, 46, 47 COM objects errors ignored during upgrade in events raised by, 312 lifetimes in Visual Basic 6, 204 wrapping an XML service around existing, 446–47 COM references, 111 COM server, creating a .NET client to talk to, 180–81 COM Transaction Integrator (COMTI), 349 COM+ attributes specific to, 353–54 compared to COM, 350 in distributed applications, 461 requirements in Visual Basic .NET, 350–51 settings, 356 COM+ application proxies, 440, 461–64 COM+ applications, 347–48 registering, 358–59 remoting and, 461 removing, 359 COM+ classes sample with attributes, 354–55 structure of, 351 COM+ components, 360–63 COM+ services, 348–50

ComboBox for the Northwind Database Viewer application, 451 upgrading, 128 upgrading properties, methods, and events of, 472–74 “ComboBox property was not upgraded” design error, 168 “ComboBox property was not upgraded” upgrade issue, 162 COMException, 296, 299 Comic Sans MS font, 210 command-line arguments, 122–23 command-line debugger, 113–14 command-line upgrade tool, 99–100 Command object, 418, 425 CommandButton, 128, 475–77 comments embedding in C#, 17 preserving, 118 Common Dialog ActiveX control, 413 common framework for all .NET languages, 6 common language runtime, 21 code running under, 46 default properties no longer supported, 199 companion CD Architecting for Remoting sample, 457 Bind OLE Picture application, 327 COMPlusClass project, 358 DefaultProperties sample, 200 DynamicApp.sln sample application, 385–401 examples in Chapter 14, 305 FileReadAndWrite.sln, 390 FontTest sample application, 210 FormCollectionClass.vb file, 335 Graphics Features project, 394 LateBinding Performance project, 207 ListBoxExample sample, 202 MyButton.vbp project, 131 Northwind.mdb, 435 OLEDragAndDrop sample application, 214, 217 PBar sample Visual Basic 6 application, 406–7 PrintForm application, 338 prjADOEvent, 311 prjADORuntime, 318 prjFirstUpgrade project, 80 Registry Features project, 392 sample applications on, 199 Simple Remoting example, 453 Simple Web Service sample, 441 SimpleTransaction, 360–61 SOAP Services example, 462 TranslatorClient, 178, 179 TranslatorServer, 178, 179 Web Services and ADODB sample, 448 XPTheme sample, 398

526

compatibility

compatibility with COM clients, 194 reasons for breaking, 6–8 compatibility library, 119 functions provided by, 142 MSBind .NET class in, 137 support for control arrays, 135 Compensating Resource Manager, 349 compilation, background, 18 compilation errors flagging in real time, 16 reporting of, 109 compile errors, upgrade issues warning of, 152 Compile tab of a Project Properties dialog box, 182 compile-time validation lost by reliance on the Variant type, 64, 65 provided by early binding, 207 compiler background, 16 binding of objects and methods, 69 errors compared to run-time errors, 296 upgrading Visual Basic 6 settings, 127 compiling Visual Basic .NET compared to Visual Basic 6, 106 complete upgrade to Visual Basic .NET, 47 complex binding, 316 complex expressions, simplifying, 114–15 COMPlusClass project, 358 Component Services MMC, 359 component tray, 85 ComponentAccessControl attribute, 353 componentization of an application, 439 components attaching attributes to, 352–53 no direct replacement of Visual Basic 6 by .NET, 190 sharing in closed environments, 21 upgrading one at a time, 175–76 COMTIIntrinsics attribute, 353 conditional compilation constant settings, 123–24 conditional compilation statements maintaining after an upgrade, 224 upgrading, 171 Configuration Properties folder, 124 conn reference, setting to Nothing in Visual Basic 6 vs. .NET, 205 Connection object, 418, 425–26 connection pool getting connections from, 432 increasing churn in, 433 connections, 432–33. See also database connection “Constant expression is required” compiler error, 225 constant values, defining, 226, 227 “Constant was not upgraded” upgrade issue, 161

constants declaring as colors, 170 defining to represent a property, 224 proper usage of, 67 upgrading, 161 in Visual Basic 6, 66 construction not supported by COM objects in Visual Basic 6, 76 in Visual Basic .NET, 75–76 ConstructionEnabled attribute, 353, 355 constructors calling, 76 defining for user-defined types, 246 container controls, 287 Context parameter of MsgBox and InputBox, 167 context-sensitive Help, reimplementing in Visual Basic .NET, 371, 372 context sharing, enabling between COM+ and .NET Framework classes, 351 control anchoring, 14, 394 control array classes, 135 “Control array element 1 doesn’t exist” error, 275 control arrays, 135–36, 318 control flow, 227–32 “Control was not upgraded” design error, 167 controls adding dynamically at run time, 333 adding to a Windows Forms project, 104–5 adjusting the size of, 394 benefits of upgrading ActiveX to Windows Forms, 404–5 binding to a database image, 327–28 binding to ADO objects, 316 displaying all associated properties and methods, 410–11 explicit declaration and allocation of, 133 global use of, 404 indexing, 334 with no subobjects, 414 normal compared to Windows XP, 400 removing by name in Windows Forms, 334 removing dynamically at run time, 333 replacing ActiveX with Windows Forms, 405–6 resolving the name of, 164 returning complex structures, 414 setting properties for, 104–5 support for OLE drag and drop in Visual Basic 6, 214 upgrading manually, 406–12 controls collection, 333–35 Controls.Add, 32 conversion, performing a narrowing, 89 conversion functions adding after an upgrade, 141 for common ActiveX object types, 295

conversion helper functions, listing of

527

conversion helper functions, listing of, 294–95 Cooper, Alan, 265 copy function, replacing an LSet statement, 248 CopyMemory Windows API function, 261–63 CopyTo method, 161 CorDbg, 113–14 Cos function, 141–42 “Could not find file” global warning, 169 “Could not load referenced component” global warning, 169 “Couldn’t resolve default property of object” upgrade warning, 166 Courier font, 210 Courier New font, 210 Create Symbolic Debug Info check box, 182 CreateInstance method, 244–45, 389 CreateSubKey method, 393 cross-language interoperability, 15–16 cryptographic key pair, 357 CrystalReports package, 147 CShort keyword, 36 CtlRefresh method, 411 CType keyword, 36 Currency data type, 8, 223 current class instance, 36 CurrentConfig property of the Registry object, 394 CurrentUser property, 393 CurrentX statement, 271 cursor, 316 Cursor object, assigning to a numeric type, 296 CursorToIPicture conversion function, 295 custom mouse pointers, 163 custom property editors, 342 custom tokens, 109–10 Customize Toolbox component picker, 326 CVErr function, 160

D
DAO (Data Access Objects), 25–26, 63, 310 DAO data binding, 63, 307, 308 DAO Data control, 308 DAO-related elements, 147 DAODBEngine_definst variable, 310–11 dashboard in DynamicApp, 386 data creating multiple views of, 429–30 synchronizing access to, 251 data access code, 310–15 forms, 378–79 models, 25 technologies, 63, 305–21 in Visual Basic, 306–8 Data Access Objects. See DAO

data binding, 69, 307, 430–31. See also ADO data binding; DAO data binding; early binding; late binding; RDO data binding adding and removing, 138–39 with ADO.NET data sources, 422 changing DAO and RDO to ADO, 147 with code, 378 to a control, 430 with a data class, 378–79 forcing, 431 with Web Forms controls, 431 data binding properties, setting at run time, 318–20 Data control, 128, 134 data environments, 315 data forms, 367 data object model of ADO.NET, 417 data persistence, .NET Framework vs. ActiveX, 146 data repositories, creating different forms of, 428–29 data types, 238–49 standardizing across languages, 6 upgrading based on size, 234 upgrading to fit, 143–44 DataAdapter, 420, 428 database class in the Architecting for Remoting sample, 457–59 database connection, 313–14. See also connections database images, binding controls to, 327–28 DataBind, calling on the Web Form DataGrid, 431 DataEnvironment class, 147 DataEnvironment designer, 147, 289 DataField property controlling simple binding, 317 of a TextBox control, 137, 138 DataFormat property, controlling simple binding, 317 DataGrid control binding an ADO Recordset to, 422, 423 mapping to Visual Basic .NET, 413 DataMember property, controlling simple binding, 317 DataReader class, 419 DataReader object, 427, 428 DataRelation class, 419 DataReport designer, 147 DataReport Writer, 289 DataSet class, 419, 420 DataSets, 419, 428, 429, 431 DataSource interface, 146 DataSource property controlling simple binding, 317 not supported by Visual Basic .NET controls, 378, 379 of the QueryDataGrid, 450 of a TextBox control, 137, 138 DataSourceBehavior property, 146 DataTable class, 419

528

DataTables

DataTables, 309 converting Recordsets to, 422 data binding with, 430 specifying relationships between, 419 DataViews, 429–30 Date data type, 67 date editor, 342 Date object, 68 DbgCLR, 114 DBGrid control, 288 DBNull.Value, 240 DDE (Dynamic Data Exchange), 271–73 DDE communication, replacing with COM, 272 DDE helper class, 272 DDE-related API functions, 273 debugger, changes in Visual Basic .NET, 42–43 Debugger Users group, 184 DebuggerHidden attribute, 12 debugging problem-solving techniques, 112–15 between a Visual Basic 6 client and .NET server, 187–88 in Visual Basic .NET, 107–8 between Visual Basic .NET clients and Visual Basic server, 182–84 Debugging property, 123 Decimal data type, 8, 223 “Declaration type not supported” upgrade issue, 161, 243 Declare statements creating for SendMessage in Visual Basic 6, 253 creating Windows API functions, 252 declaring multiple for the SendMessage function, 253–54 upgrading Integer and Long parameters, 252 “Declaring a parameter As Any is not supported” upgrade issue, 161 deep object model, 414 “Def statement was removed” upgrade note, 170 Default design-time property setting, 133 default font in Visual Basic 6, 210 default form, 277 default form instance, 277–78 default instances as a solution for module methods, 310 Default keyword, 36 default properties eliminating the use of, 203 no longer supported in the common language runtime, 199–201 resolving, 92 run-time differences from, 201–3 stating explicitly, 199–201 support of implicit, 202 Visual Basic 6 compared to .NET, 7

DefaultProperties sample, 200 defaults for Option statements, 89 DefInstance property, 277, 278 DefInstance shared method, 278 DefInt, 62 DefType statement, 143 delegate declaration, 257 Delegate keyword, 36, 257 delegate type, 254 DeleteSubKeyTree method, 393 DeleteValue method, 394 dependency hierarchy, 58, 94 deployment with Windows Forms controls, 405 deprecated features, removing, 62–63 Description attribute, 353 design errors listing in an upgrade report, 156 listing of, 167–69 design issues, 154 design-time licenses, 169 design-time property settings, 407–10 design-time settings, 134 design view, forms in, 266 designers, 147 destination directory, specifying in Upgrade Wizard, 83–84 deterministic finalization, 204 deterministic lifespan of a variable, 22 deterministic memory-management scheme, 205 development environment improvements in, 15–16 Visual Basic 6 vs. Visual Basic .NET, 4, 29–34 Devenv.exe, 29 DHTML designer, 289 DHTML pages, 5 DHTMLReport WebClass designer, 147 Dim...As New statements, 207–8 Dir function . and .. directories not returned by, 165 marking with an upgrade warning, 154 Dir$ function, calling in Visual Basic 6, 387 Dir method, warning about, 369 DirectCast keyword, 36 directories, reading the contents of, 387–88 directory name, returning from a file path, 388 DirListBox, 128, 477–79 disconnected Recordsets, 447 mapping to DataSets, 419 retrieving, 428–29 Dispose event, 316 Dispose method, 24 calling, 24, 315 destroying graphics objects, 398

distributed applications

529

distributed applications definition of, 436 upgrading, 435–64 distributed technologies, 440 DLL/Custom Control Library option, 82 DLL-exported functions, 302 DLL projects adding in Visual Basic 6, 94 upgrading, 82 DLLs conflicts during installation of Visual Basic 6 applications, 401 eliminating conflicts, 358 finding all forms in, 388–89 loading dynamically, 389 “DoEvents does not return a value” upgrade issue, 160–61 Donut Shape check box, 396 DoTasks method, 363 Double value, Date data type implemented as, 67–68 drag-and-drop operations. See also OLE drag and drop; Visual Basic drag and drop in Visual Basic 6, 213–15 in Visual Basic .NET, 215–19 DragDrop event for a form or control, 273 drawing, 268 drawing code, 270 DrawMode statement, 271 DrawString method, 331 DrawStyle statement, 271 DrawWidth statement, 271 DriveListBox, 128, 479–81 DTPicker ActiveX control, 413 dummy form, creating for ActiveX controls, 334 dynamic arrays, 234, 235 dynamic cursors, 428 Dynamic Data Exchange. See DDE dynamic data types, 234 dynamic properties, 390–92 dynamic registration, 358–59 DynamicApp sample application, 385, 386–87

E
early binding, 69 advantage of always using, 201 compared to late, 207 forcing, 206–7 Edit And Continue, not yet available in Visual Basic .NET, 107 embedded objects, 324 Empty keyword, 63, 73

empty strings replacing all instances of App.HelpFile with, 372 substituting for Null values, 314 Enabled property, enabling the timer, 167 English-to-Spanish translator example, 180–81 Enter event, 267 enterprise architecture with legacy or distributed systems, 57 enumerations, 212 enumerator members, defining as constant types, 226 EnumWindows API function, 254 Eqv, 62 Erase statement, 171 error-handling block, 11 error trapping, adding to events, 313 errors in events, 311–13 obtuse, 114 reducing, 13 undetected by Upgrade Wizard, 172–74 errors, warnings, and issues. See EWIs event code updating in a Windows Forms control, 411 upgraded, 90–92 event firing differences, 274–76 event handlers, 36 “Event may fire when form is initialized” upgrade warning, 166, 275, 276 event name collisions, 297 “Event parameter was not upgraded” upgrade issue, 162 event parameters, 39 “Event was not upgraded” upgrade warning, 165 EventArgs object, 39 eventArgs parameter, 90–91 EventClass attribute, 354 events associated by name in Visual Basic 6, 38 changing to procedures, 171 declaring public in a separate event interface, 191, 192, 193 design error for new behavior, 167–68 errors in, 311–13 firing as components are initialized, 166 mapping the upgrade of individual by object, 467–515 not supported for forms, 268–69 passing in Visual Basic .NET, 90–91 renamed for forms, 267 Visual Basic 6 vs. Visual Basic .NET, 38 eventSender parameter, 90 EventTrackingEnabled attribute, 354

530

EWIs

EWIs, 151 listing of, 160–71 types of, 152–55 working with, 159 Excel, loading upgrade report issues into, 157–58 exception handling, 11 ExceptionClass attribute, 354 exceptions generated by an upgraded project, 86 requiring type conversions, 295–96 EXE projects, 82 EXE Server projects, 82 Execute method of the ADO Command object, 426 ExecuteNonQuery method, 426 ExecuteReader method, 426 ExecuteScalar method, 426 ExecuteXmlReader method, 426 execution path, upgrading the code in, 224 explicit code, 92 explicit conversions, 141 explicit declaration and allocation of controls, 133 explicit dereferencing, 204 explicit types, Upgrade Wizard and, 64 explicit variable declaration, 65, 76 export package, 463–64 expression shortcuts, 12 expressions, simplifying complex, 114–15 extended design-time settings for ActiveX controls, 407 extended PMEs, 289 extended property settings, 407–9 extensibility interfaces, 289

F
Fade In button, 395 fade out feature for forms, 88 fat-client systems, 56–57 features added in Visual Basic .NET, 6, 223 graphics-related, 394–98 handled by the Upgrade Wizard but not recommended for use, 62 in the IDE, 15–16 not handled by the Upgrade Wizard, 63 out-of-date, 269 remoting, 452 unique in Visual Basic .NET, 17–18 file format compatibility of Visual Basic and .NET files, 233 file functions, 232–37 mapping from Visual Basic 6 to Visual Basic .NET, 232 new in Visual Basic .NET, 387–92 file handles, closing, 23

file path, 388 file printing, full-line vs. partial-line, 233 file statements, 232 FileClose function, 232 FileCopy statement, 232 FileGet function, 232, 237 FileGet statement, 236 FileListBox control, 129 FileListBox object, 481–83 filenames returning an array of, 387 returning from file paths, 388 FileOpen function, 232 FilePut function, 232 FileReadAndWrite sample application, 389–90 files not finding during an upgrade, 169 opening for writing, 390 reading and writing Visual Basic 6 in .NET, 233 reading from and writing to, 389–90 renaming with internal names, 127–28 FileWidth function, 232 FillColor statement, 271 FillStyle statement, 271 Finalize event, 316 Finally keyword, 37 firehose Recordsets, 419, 427–28 fix time, estimating, 157–58 fixed-length array declarations, 246 fixed-length arrays, 234 fixed-length strings not supported in Visual Basic .NET, 40, 223 reading from random-access files, 237 supporting, 259–60 upgrading in structures, 261 fixed-size arrays declaring variables of a type containing, 153 defining structures with, 164 FixedLengthString class, 260, 261 FixedSys font, 210 flat-model ActiveX controls, 414 flat object model, 414 FlatStyle property, 399 floodgate effect, 8 Focus event, 267 Font events, 165 Font property, 291 Font types, converting, 295 fonts supported in Windows Forms, 168–69 types of, 209 upgrading from Visual Basic 6, 210 FontTest sample application, 210, 211

FontToIFont conversion function

531

FontToIFont conversion function, 295 ForeColor property, 294 form background, fading from black to white, 330 form designer in Ruby, 265 form fade out, 88 “Form method was not upgraded” upgrade issue, 328 Form object, 484–87 Form Opacity check box, 395 “Form property <formname>ScaleMode is not supported” upgrade issue, 162 Form.BorderStyle, 171 FormCollectionClass.vb file, 335–36 Form.Load event, 274 Form.Paint event, 329 Form_Resize event, 394 forms, 274 adding WebBrowser controls to, 326 in any type of .NET project, 34 changing the regions of, 396–97 changing the shape of, 396–97 code behind, 144–45 creating instances of, 389 differences between Visual Basic 6 and Visual Basic .NET, 274–83 fading in, 395 finding all in a DLL, 388–89 higher number of issues with, 159 identifying differences in the design of, 154 listing in an array, 389 loading dynamically, 389 making semitransparent, 14 opening from Sub Main, 209 printing, 337–40 returning the number of open, 160–61 as startup objects, 209 upgrading, 120, 128–30, 266 forms-based client/server applications, 56–57 forms collection considering the need for, 337 in frmMain_Closed, 374–75 implementing in Visual Basic .NET, 335–37 upgrade issue generated by, 161 upgrading, 335–37 “Forms collection was not upgraded” upgrade issue, 335 forms development systems, 14 forms packages, 34–35, 265 Forms3, 35 forward-only Recordsets, 427–28, 449 Frame control, 129 Frame object, 488–89 Framework SDK, debuggers included with, 113, 114 .frm file, 130–31, 132, 133 frmAbout form, 366, 369

frmBrowser form, 366, 378 frmDocument form, 367 frmLogin form, 366, 370 frmMain form, 366, 371–72 frmOptions form, 367 frmSplash form, 366, 376–77 fromMain_Closed, renaming Form_Unload to, 374 function calls, processing overhead of, 437 “function is not supported” upgrade issue, 160 function parameters, declaring as delegate types, 254 functional tiers of an application, 439 functions commenting out noncritical, 159 with different behaviors in Visual Basic .NET, 165 exposing as Web services, 189 mapping to equivalent, 141–42, 515–20 null-propagating, 241 overloading, 12 parentheses required with, 92 fusion, 358

G
garbage-collected variables and objects, 4 garbage collection, 203–5 forcing, 25, 205–6 freeing the developer from memory-management issues, 205 Garbage Collector (GC), 22 Garbage Collector-managed memory, 261 Garbage Collector method, 344 GCHandle structure, 261 GCHandle.Alloc, 262 GCHandle.Alloc method, 344 GDI+, 331 graphics drawing surface, 398 graphics object, 329 object library, 328, 331 in Windows Forms, 14 Generate Default Interfaces For All Public Classes option, 82 generic objects, 206–7 generic System.Array type, 301 Get statement, 232 GetActiveMdiChild property, 373 GetComInterfaceForObject function, 261 GetEnumerator method, 220, 221, 222 getImageFromForm method, 338 GetOcx, 296 GetType keyword, 36 gizmos, 265 global binding variable, 320 global default instance variable, 310 global error handler, 11

532

global form count

global form count, 280–81 Global Issues in the upgrade report, 156 global multiuse class attribute, 146 global objects, 145, 268 global project setting, 123 global single use class attribute, 146 global use of controls, 404 global warnings, 155, 169–70 GoSub statement fixing, 160 not supported in Visual Basic .NET, 227 performing a suboperation reusing local variable values, 228 replacing with ShowDetail, 228–29 upgrading, 228 GoSub...Return statement, 63, 223, 227–29 GotFocus event, 267 GoTo, 62 graphics new features, 394–98 Visual Basic 6 compared to Visual Basic .NET, 270–71 Visual Basic 6 properties and methods related to, 268 Graphics Effects form in the Graphics Features project, 394 graphics methods on forms in Visual Basic 6, 270 upgrading, 328–31 graphics objects, 398 group file, 85 GUI debuggers, 114 GUIDs, 194

HScrollBar, 129, 490–91 HTTP protocol, 452 human-readable language, 17 human-readable names, associated with type identifiers, 28

I
IconToIPicture conversion function, 295 ID attributes, 191, 193 IDE (Integrated Development Environment), 29 new features in, 15–16 redesign of, 4 for Visual Basic .NET, 101–2 IDispatch interface, testing for, 161 IDisposable interface, 24 “#If #EndIf block was not upgraded” upgrade note, 171 #If...#End If precompiler statements, 224 IFontToFont conversion function, 295 #If...Then conditional statements, 123 #If...Then directives, 118 Image control, 129 Image object converting to an IPictureDisp, 293 upgrading properties, methods, and events of, 491–93 Image statement, 271 ImageList ActiveX control, mapping, 413 images, binding controls to, 327–28 ImageToIPicture conversion function, 295 ImageToIPictureDisp compatibility library function, 293 ImageToIPictureDisp conversion function, 295 IMEStatus function, 160 Imp, 62 implementation data types, 67–68 implementation inheritance, 10 Implements keyword, 82 implicit default properties, 202 implicit instantiation, 208 implicit object instantiation, 74–76 implicit variable declaration, 65 Imports keyword, 36 Imports statement, 27 in category for upgrading, 148 in-process method invocation, 437 indeterministic lifespan of a variable, 22 index values, 416 indexed property declarations, attribute for, 36 indirect approach for creating Visual Basic .NET components, 190 indirect replacement model, 190–91 inheritance, 10–11, 52, 223 Inherits keyword, 10–11, 36 Inherits statement, 223

H
handle, obtaining, 261 Handles clause, 38 Handles keyword, 36, 91 HatchBrush class, 271 HatchStyle enumeration, 271 HDC statement, 271 header information in random-access binary files, 234 Height property, 268 help creating for Visual Basic .NET applications, 125 displaying with Windows forms, 371–72 help context ID, 125 help settings, 125 Help topic for the Timer Interval property, 87 HelpFile parameter of MsgBox and InputBox, 167 Hex function, null propagation and, 241 HKEY_CURRENT_USER registry hive, 393 host process required for remoting, 452 in the Simple Remoting example, 453, 454

Initialize event

533

Initialize event, 316 Initialize method calling, 153–54, 163 inserting within a structure, 246–47 “‘Initialize’ must be called to initialize instances of this structure” upgrade issue, 163 InitializeComponent subroutine copying property settings to, 410 mapping Visual Basic 6 design-time settings to, 131, 132, 133 of an upgraded form file, 408–9 INorthwindDatabase interface in the Architecting for Remoting sample, 457 Input # statement, mapping to Input function, 232 Insert Breakpoint from the shortcut menu, 110 instantiation by remote applications, 348 instrumentation of release builds, 113 Int32 value, converting to a UInt32 value, 294 Integer data type, 91 Integer numeric type, 252 Integer type, changing to the delegate type, 257 integer values, representing enumerations, 212 Integer variable storage size for, 143 upgrading to Short, 143, 144 Visual Basic 6 vs. Visual Basic .NET, 233 integrated development environment. See IDE interface inheritance, 10, 11 Interface keyword, 11, 36 InterfaceQueuing attribute, 354 interfaces, 456, 457 interfaces assembly, 456–57 internal data binding manager objects, 288 internal name, renaming files with, 127–28 internationalization, 15 interoperability upgrade option, 47 interoperation among COM components, 177 Interval property, setting to zero, 167 IntPtr, 262 intrinsic controls, mapping Visual Basic 6 to Windows Forms, 128–30 invalid file format, 169 “Invalid picture” error, 293 InvalidCastException, 200, 296 IPictureDisp ActiveX type, 293 IPictureDispToImage conversion function, 295 IPictureToImage conversion function, 295 IsDBNull, upgrading IsNull to, 165 IsEmpty function, 73, 140–41 ISerializable interface, 442 ISimpleFrame interface, 139 IsMdiContainer property, 282 IsMissing function, upgrading to IsNothing, 238–40 “IsMissing was changed to IsNothing” upgrade note, 171

IsNothing function replacing IsMissing, 171 upgrading, 140–41 upgrading IsMissing to, 239 IsNull function, 73, 165 IsObject function, 140–41, 165 IsReference function, 165 issues, loading into a spreadsheet, 157–58 ItemData property, 168 iteration in disconnected Recordsets vs. DataSets, 429 IVBGetControl interface, 288

J
just-in-time activation, 349 JustInTimeActivation attribute, 354

K
key file, 357 key pair files, 357 KeyAscii keypress parameter, 167 keywords, added to Visual Basic .NET, 35–37 Kill statement, mapping, 232

L
Label control, 129 Label object, 493–95 Language property of a form, 15 language-related upgrade issues, 224–37 language statements, 232 languages common environment shared by, 21–22 in the Visual Studio .NET IDE, 29–30 large-scale distributed applications, core concepts behind, 435–39 late binding, 17, 69, 70–72 compared to early, 207 disadvantage of, 201 forcing, 206–7 prohibiting, 13 late-bound variables setting to a value, 166 upgrading properties of, 149–50 LateBinding Performance project, 207 LateBoundCopy method, 200, 201 layout and design-time property settings, 130–34 LayoutKind parameter, 259 LBound, 242 LCase function, 241–42 Leave event, 267 Left function, null propagation and, 241 Left property, setting with Location, 267–68 Left$ function with Null, 73 LeftB function, 142

534

legacy applications, upgrade scenario

legacy applications, upgrade scenario, 47 legacy code, cleaning up, 62–63 legacy systems, upgrading back-end, 57 library applications, 348 life cycle of applications, 208 managing for applications, 279–80 of MDI form applications, 282 of OLE drag-and-drop operations, 215–16 of the Simple Remoting example, 454 of the startup form, 279 Line control, 129 “line couldn’t be parsed” global warning, 170 Line Input # statement, 232 Line method, 328 Line object, 495–96 Line statement, 271 lines, drawing in Visual Basic .NET, 329 linked objects, 324 ListBox adding the contents of a TextBox control to, 202–3 adding to a Windows Forms project, 104, 105 upgrading, 129 upgrading properties, methods, and events of, 496–99 “ListBox|ComboBox property <control>.NewIndex was not upgraded” upgrade issue, 162 “ListBox|ComboBox was not upgraded” design error, 168 ListBoxExample sample, 202 ListView ActiveX control, 413 ListView Columns property, 33 ListView ListItems subobject, 299 Load event upgrade events firing before, 276 Visual Basic .NET events that can occur before, 274 Load <formname> statement, 160 “Load statement is not supported” upgrade issue, 377 LoadBalancingSupported attribute, 354 LoadResStrings function, 163 LoadResStrings method, 379–81 “LoadResStrings method may need to be replaced” upgrade warning, 163 LoadUpgradeReport code, 158 Localizable property of a form, 15 LocalMachine property of the Registry object, 394 Location property mapping Left and Top settings to, 133 setting, 267–68 Lock statement, mapping, 232 Log method, 113 logical separation of code, 439 login dialog box, adding to an application, 370 Long numeric type, 252

Long variable storage size for, 143 upgrading to Integer, 143, 144 Visual Basic 6 vs. Visual Basic .NET, 233 loosely coupled applications, 423, 436 loosely coupled events, 349 LostFocus event, 267 “Lower bound of array was changed to 0” upgrade warning, 164, 242 lower bounds, specifying for arrays, 242 “LSet cannot assign one type to another” upgrade issue, 161, 248 LSet statement, 63, 247–49

M
“magic” properties, 317 main form in an application, 279 MainMenu components, dragging onto a form, 30 Make Project Group, 96 Make tab for Project Properties setting command-line arguments under, 122–23 setting conditional compilation constants, 123–24 managed code, 46 managed executables, 46 managed providers, 421 manifest file, 399 manual drag-and-drop application, 214 manual registration of COM+ components, 358, 359 MarshalAs attribute, 258, 259–60 MarshalByRefObject class, 453 marshaling overhead for a loosely coupled application, 436 marshaling attributes, 164, 258, 259 Masked Edit ActiveX control, 32 math functions, mapping, 141–42 MBindingCollection, 138 MDAC, 311 MDI child forms accessing controls on, 372–73 specifying, 282 MDI form applications, lifetime of, 282 MDI projects, Clipboard in, 375–76 MDIChild property, 282 MDIForm Object adding in Visual Basic 6, 282 upgrading properties, methods, and events of, 499–501 MDIParent property, 282 member functions of the ServicedComponent class, 351–52 memory address obtaining to a string, 262 returning, 343–45 memory leaks, 205 memory management, 22–25

Menu Editor

535

Menu Editor, 30–31 Menu object, upgrading properties and events of, 502 menus, inserting, 30 metadata, 352 method invocation, 437–38 methods declaring public in an interface, 191, 192, 193 design error for new behavior, 167–68 mapping the upgrade of individual by object, 467–514 mapping Visual Basic 6 to equivalent .NET functions, 515–20 not supported for forms, 268–69 renamed for forms, 267 Microsoft Access databases, cursor location with, 316 Microsoft Data Access Components (MDAC), 311 Microsoft Intermediate Language (MSIL), 22 Microsoft Sans Serif font, 210 Microsoft Visual Studio .NET. See Visual Studio .NET Microsoft Web Browser control, 130 Microsoft Windows XP user interface, controls in, 398–400 Microsoft.VisualBasic.Compatibility.Data library, 307 Microsoft.VisualBasic.Compatibility.VB6.DirListBox, 477 Microsoft.VisualBasic.Compatibility.VB6.DriveListBox, 479 Microsoft.VisualBasic.Compatibility.VB6.FileListBox, 481 Mid function, null propagation and, 241 Mid$ function with Null, 73 MidB function, 142, 160 middle tier, replacing with XML Web services, 423 “<Missing>“ parameter value, 240 missing value, 238 MkDir statement, mapping, 232 mnuHelpAbout_Click event, 371 mnuHelpSearchForHelpOn_Click event handler, 372 mnuViewWebBrowser_Click event in frmMain, 378 Modern font, 210 Module keyword, 36 module methods, 309 code using, 161 not supported in Visual Basic .NET, 302–3 Module1 module, 367, 379 MonthView ActiveX control, 413 mouse pointer constants, 66 mouse pointers, 163 MousePointer property of an ActiveX control, 295–96 MS Sans Serif font, 210 MS Serif font, 210 Msado15.dll, 311 MSBind ActiveX component, 288 MSBind collection, 138 MSBind .NET binding collection, 138 MSBind .NET class, 137

MSBind.dll COM library, 307 MSIL, 22 “MTS/COM+ objects were not upgraded” global warning, 170 MTS pooling, 29 multiple document interface (MDI) child forms, 171 multithreaded components, 29 multithreaded environments, 249 multithreading, 13, 223 multitiered applications, 175 multiuse class attribute, 146 MustInherit keyword, 36 MustOverride keyword, 36 MustRunInClientContext attribute, 354 MyBase keyword, 36 MyButton.vbp project, 131 MyClass keyword, 36

N
name collisions, 297 Name property of a Windows Forms control, 410 named constants creating a set of, 212 readability of, 66 names, associated with type identifiers, 28 Namespace keyword, 36 namespaces, 27 importing, 27 remoting requirement for the client and server class to reside in the same, 455–56 narrowing conversion, 89 native code, 46 native language statements, mapping to, 140–41 Navigate method with WebBrowser ActiveX controls, 325 negative lower bounds in array declarations, 242–43, 243–44 nested scopes, 41 .NET clients communicating with COM components, 177 creating to talk to COM servers, 180–81 .NET collections, 299–300 .NET components, 20 adding features to upgraded, 187 COM applications communicating with, 178 exposing to a Visual Basic 6 client, 184–87 registering for COM, 178 from Visual Basic 6, 58 .NET Framework, 13, 21–22. See also Visual Basic .NET accessing the registry, 392 vs. ActiveX, 19–29 COM+ services, 349 elements of, 22–29 file methods, 389

536

.NET Framework

.NET Framework (continued) printing model in, 339 types of DataAdapters, 420 UpDown control, 288 wrapping the COM component in a runtime callable wrapper (RCW), 177 .NET GDI+ object library, 328, 331 .NET object type, 292 .NET part of an ActiveX .NET control, 289 .NET platform, 4, 6, 8–9 .NET references, 111 .NET remoting system. See remoting .NET runtime instructions, 22 memory management by, 22 pointers and, 62 .NET server, exposing to COM, 186 .NET serviced components, working with COM clients, 364 .NET types assigning to ActiveX types, 296 converting to another .NET type, 295 converting to the equivalent ActiveX type, 292–93 .NET version of the ADODC control, 137 .NET Windows form as a control host environment, 286 .NET Windows Tab control, 287 New, declaring arrays of classes with, 164 New event, moving the ADO Initialize procedure into, 316 New Project dialog box, 102, 103, 365–66 New statement different behavior in Visual Basic .NET, 172 in Visual Basic 6, 7 NewEnum property, commenting out, 220, 221, 222 “NewEnum property was commented out” upgrade note, 170 NewIndex property of a ComboBox or Listbox control, 162 no-drop icon, 273, 274 nodes, adding in a bottom-up manner, 415 non-TrueType fonts, 210 nonconstant expressions, 224–25 nonconstant values, 226–27 nondeterministic memory-management scheme, 205 nonvisual controls, displaying in the component tray, 85 nonzero-based arrays, 223 nonzero-bound arrays, 301 nonzero lower bounds, 242 normal controls, compared to Windows XP controls, 400 Northwind Microsoft Access database, 305, 435 Northwind Viewer client application, 448, 450–51 NorthwindDatabase XML Web service, 448–49 Nothing, setting objects to, 171

Nothing state, 238 NotInheritable keyword, 36 NotOverridable keyword, 36 Null, 63, 165, 240 Null keyword, 73 Null propagation, 165, 241 Null values avoiding upgrade errors associated with, 314 coercing to an empty string, 73 propagation of, 73 NullReferenceException at run time, 208 numeric key indexes for collections, 162 numeric-to-object conversion function, 226 numeric values, passing to Windows API functions, 253 NumericUpDown controls, 140

O
object construction, 349 “<object> could not be resolved because it was within the generic namespace” upgrade issue, 162 object instantiation, 74 “Object may not be destroyed until it is garbage collected” upgrade note, 171 object-oriented approach, to adding or navigating a control’s subobjects, 414 object pooling, 349 object properties, direct editing of, 33 Object property of an ActiveX control, 297 “Object reference not set to an instance of an object” NullReferenceException, 247 Object type mapping to a .NET object type, 292 in the .NET Framework, 40 upgrading Variant to, 143–44 Variant-like behavior of, 238 “object was not upgraded” upgrade issue, 161 ObjectPooling attribute, 354 objects assigning in Visual Basic 6, 7 ensuring the destruction of, 205–6 explicitly declaring, 76 forcing to release resources, 24 generic, 206–7 in the .NET Framework, 268–69 mapping references from Visual Basic 6 to Visual Basic .NET, 467–514 preventing the unintentional use of, 456 redrawing, 329 setting to Nothing, 171 “Objects of type vbDataObject are not supported” upgrade issue, 161 ObjPtr function, 63, 261 eliminating, 343–45 not supported in Visual Basic .NET, 261–63 upgrade issue generated by, 160

obsolete features, removing from Visual Basic 6 applications

537

obsolete features, removing from Visual Basic 6 applications, 62–63 obtuse errors, 114 OCX controls, 403. See also ActiveX controls OcxState setting, deleting from an ActiveX control, 408 OffSetOf function, 261 OLE Container control with linked object, 324 replacing, 323–28 OLE control, 130 OLE control extension. See OCX controls OLE drag and drop, 213, 273 OLE objects, binding controls to, 324 OLE_ types, 301–2 OLE_COLOR property, 291 OleDb namespace, 425 OleDb providers, 421, 432 OleDbCommand class, 426 OleDbConnection object, 421 OleDbDataAdapter method, 420, 422, 450 OleDbDataAdapter.Fill method, 422 OLEDrag event, 165 OLEDrag method, 152 OLEDragAndDrop sample application, 214–19 OLEDragOver event, 165 OLEDropMode property, 154 On...GoSub statement, 160, 231–32 On...GoTo statement, 229–30 opacity property, 395 open forms returning the number of, 160–61 unloading in SDI and Explorer applications, 374–75 Open Project dialog box, 81 Open statement, 232 OpenDatabase module method, 309 operators, mapping Visual Basic 6 to equivalent .NET functions, 516, 517 Option Compare statement, 89 Option Explicit statement, 89, 143 Option statements, 89 Option Strict On, 13, 18 Option Strict statement, 36, 89 optional parameters, 17, 239, 292 OptionButton object, 130, 502–4 options, setting in Upgrade Wizard, 82 Options dialog box in Visual Studio .NET, 110 OrElse keyword, 36 OsWinHelp API, 370–71 out category for upgrading, 120, 148 out-of-date features, 269. See also features out-of-date technologies, moving to Visual Basic .NET, 269–74 out-of-process method invocation, 437

overhead for a loosely coupled application, 436 in method invocation, 437–38 overloaded functions, 12 Overloads keyword, 36, 223 Overridable keyword, 36 Overrides keyword, 37

P
packages, 289 paint code, debugging in Visual Basic .NET, 43 Paint event in GDI+, 330 in Visual Basic .NET, 270 PaintImage method, 331 painting, not allowed in break mode, 42–43 painting functions, replacing, 328–31 PaintPicture method, 328 PaintPicture statement, 271 Panels, upgrading PictureBoxes to, 162 “ParamArray was changed from ByRef to ByVal” upgrade warning, 164 parameter initialization values, setting to “<Missing>”, 240 “parameter is not supported” upgrade warning, 167 parameter types, declaring As Any, 253–54 parameterized constructors, 76 parameters passing by value in XML Web services, 442 upgrading and qualifying unqualified, 144 parentheses with function calls, 92 indicating parameters not to be set, 299 required on subroutine calls, 37 partial upgrade options, 46–47 PBar sample Visual Basic 6 application, 406–7 Peek method, 390 performance gains with upgraded applications in real-world systems, 55 guidelines for data access, 432–33 as a reason to upgrade, 52–55 persistable classes, 146 physical factors, determining upgrade suitability, 55–58 physical resources, releasing, 205 Picture (bitmap) property, exposing as System.Drawing.Image, 290–91 “Picture will be tiled” design error, 168 PictureBox controls, 130, 270 PictureBoxes, 505–8 binding to fields in a table, 327 upgrading to Panels, 162 upgrading with child controls, 168

538

pictures

pictures painting in GDI+, 331 printing semitransparently, 397 pixels, graphics coordinates as, 329 platform requirements for COM+ proxy applications, 464 PME models, 267 PMEs of controls, 289–90 Point statement, 271 pointers, 62 in C#, 17 declaring to functions or class members, 254 passing to callback functions in Visual Basic 6, 254–55 returning to memory, 261 positive lower bounds in array declarations, 242, 243 predictability of reference counting in COM, 204 Print function, 233 Print method, 328 Print statement, 271 Print # statement, mapping, 232, 233 PrintDocument class, 268 Printer object, 268 Printers collection, 161 PrintForm helper class, 338 PrintForm method, 337–40 printing functions in .NET, 339 PrintLine function, 233 private class attribute, 146 private components, 349 PrivateComponent attribute, 354 prjADOEvent, 311 prjADORuntime, 318 prjFirstUpgrade project creating in Visual Basic 6, 80–81 upgrading to Visual Basic .NET, 81–84 programmable Web sites, 440 programming errors, 13 programming practices. See coding practices, common problematic ProgressBar control mapping to Visual Basic .NET, 413 replacing ActiveX with Windows Forms, 406–12 project attributes, 122–27 project filenames, 127–28 project groups, 94–98 project items created by the VB Application Wizard, 366–67 with invalid file formats, 169 in the upgrade report, 155, 156 project-level issues. See Global Issues in the upgrade report project name and time of upgrade in the upgrade report, 155, 156

project names, upgrading Visual Basic 6, 122 Project Properties dialog box, 123, 124, 125 project references, 111 project types not supported in Visual Basic .NET, 48 upgrading, 121–22 Visual Basic 6 and equivalent Visual Basic .NET, 122 in Visual Basic .NET, 103 projects, 121 building with debugging symbols turned on, 182–83 compiling referenced, 170 creating empty, 365 preparing for the upgrade, 61–76 running, 106 running as quickly as possible, 159 selecting for upgrading, 50–58 selecting the type of, 82 properties controlling simple binding in Visual Basic 6, 317 declaring public in an interface, 191, 192, 193 default, 199–201 design error for new behavior, 167–68 making dynamic, 391–92 mapping multiple into a single object property, 267–68 mapping the upgrade of individual by object, 467–514 mapping Visual Basic 6 to equivalent .NET functions, 515–20 not supported for forms, 268–69 passing ByRef to a function in .NET, 298–99 renamed for forms, 267 resolving default, 92 setting for controls, 104–5 showing in the Property Browser, 342 specifying explicitly, 201 summarizing those not upgraded, 134 properties, methods, and events. See PMEs of controls property, method, and event models, 267 Property Browser limitations in Visual Basic 6, 340 Visual Basic 6 vs. Visual Basic .NET, 32–33 in Visual Basic .NET, 340 in Visual Studio .NET, 176 property-centered approach to adding or navigating a control’s subobjects, 414 property-centered model for creating nodes, 415 property editors, writing custom, 342 “property has a new behavior” design error, 167–68 “property is not supported at runtime” upgrade issue, 162 “Property is read-only.” COMException, 299 property page editors for every .NET class, 341

property pages

539

property pages, 170, 340–42 property settings, copying from the Visual Basic 6 form file, 408–10 “property was not upgraded” design error, 167 “Property was not upgraded” upgrade issue, 162 Protected Friend keyword, 37 Protected keyword, 37 protocols, supported by remoting, 452 providers, 421 proxy class, 445 PSet statement, 271 public class, creating an interface for every, 82 public noncreatable class attribute, 146 public PMEs, 289 public/private key pair, 357 Put statement, mapping, 232

Q
Query method in NorthwindDatabase, 448, 449 QueryUnload event, 162 queued components, 349

R
random-access binary files, header information in, 234 random-access files, reading fixed-length strings from, 237 random number generator, 81 raster fonts no longer supported, 168, 209 upgrading, 210, 211 RCW (runtime callable wrapper), 177, 178 RDO (Remote Data Objects), accessing module methods, 310 RDO connection error, 314 RDO data binding, 307 not supported in Visual Basic .NET, 63 upgrading, 308 RDO DataControl, 288 RDO-related elements, 147 rdoConnection, opening, 313 RDOrdoEngine_definst variable, 310 Read method, 427 ReadFromFile method, 324 reading the contents of a file, 390 ReadOnly keyword, 37 ReadProperties event, 146 “real” inheritance, 10, 11 reconstructed Recordsets, 447 Recordset filter, setting to an empty string, 314 Recordset object, 309 Recordset type changing in Visual Basic 6, 26

Recordsets. See also cursor disconnected Recordsets; firehose Recordsets; forward-only Recordsets accessing fields of, 306 binding to .NET controls, 422–23 converting to DataTables or DataSets, 423–24 deserializing from XML, 450 forms of, 427–29 passing between tiers, 425 serializing to and from XML, 423, 424–25 with XML Web services, 447–51 red labels on forms, 134 placeholder replacing controls, 167 replacing an OLE control during an upgrade, 325 redesign problems, solutions for common, 323–45 ReDim statement, 164, 173 reference counting in COM, 203–4 referenced projects, compiling, 170 references, 111 to ActiveX controls in a Toolbox, 31–32 not finding during an upgrade, 169 removing to ActiveX control libraries, 412 References dialog box, 95 References list, viewing in Visual Basic 6, 302 reflection, 388 Refresh method for the Windows Forms ProgressBar control, 411 RegCreateKey API, 392 RegDeleteKey API, 392 regions of forms, 396 Register For COM Interop attribute, 186 registration for COM+ applications, 358–59 of a .NET component for COM interop, 186 registry, accessing, 392–94 registry editing form in DynamicApp, 386 in the Registry Features project, 392–94 registry file in Visual Basic .NET installation, 169 registry key, 393 RegistryFeatures project, 392 RegSvcs.exe utility, 359 Remote Data Objects. See RDO remote objects, calling, 456 remote process method invocation, calling overhead, 437 remoting, 440, 452–61 architecture for, 456–61 COM+ applications and, 461 example of, 453–56 features of, 452 Remove Breakpoint from the shortcut menu, 110 Remove button, disabling if no item is selected, 108 RemoveButton_Click event, 105

540

RemoveForm function

RemoveForm function, 280–82 RemoveHandle keyword, 36 repainting, not allowed in break mode, 42–43 Reset statement, mapping, 232 resizing, automatic, 394 resource file, storing a project’s strings in, 379 Return keyword, 37 Return statement, 227, 228 revision number formats, Visual Basic 6 vs. Visual Basic .NET, 127 Revision property in Windows, 369 rich-model ActiveX controls, 414 rich object model, 414 Rich TextBox ActiveX control, 413 Right$ function with Null, 73 RightB function, 142 RmDir statement, 232 role-based security, 349 Roman font, 210 Root Namespace name, 122 RsToString function, 424 Ruby, 265–67 run time, setting data binding properties at, 318–20 run-time assembly binding, 358 run-time behavior of Visual Basic .NET vs. Visual Basic 6, 4 run-time errors, compared to compiler errors, 296 run-time warnings, 154, 200 runtime callable wrapper (RCW), 177 runtime common language, 21

S
Save method on the Recordset object, 447 Save Project Group from the File menu, 95 SaveToFile method, 324 scalability as a reason to upgrade, 52 scale mode, setting, 162 Scale-mode-Constants, 161 scopes of attributes, 355 screen flicker, avoiding, 398 Screen.MousePointer property, 212 Script font, 210 SecureMethod attribute, 354 SecurityRole attribute, 354 Select Case statement changing On...GoSub to, 231–32 upgrading On...GoTo, 230 Select Data Source dialog box, 313 selection process for upgrading applications, 50–58 self-contained objects, 442 self-documenting comments in C#, 17 self-registration of COM+ components, 358 semitransparency in a Windows application, 14

semitransparent form, 395 SendMessage Windows API function, 253, 370–71 Serializable attribute, 442 serialization implementing in XML Web services, 442 supported explicitly for Recordset objects, 447 to and from XML, 446 Serialize class attribute, 442 server applications, 348 server class, creating persistable, 146 server process in the Architecting for Remoting sample, 460 server project in the Simple Remoting example, 453 server-side cursor location, 316 ServicedComponent class, 453 calling into COM+ applications, 364 inheriting from, 350, 351–52 SetAbort, calling automatically, 356 SetAttr statement, mapping, 232 SetCommit, calling automatically, 356 SetFocus event, 267 SetValue method, 393–94 Shadows keyword, 37 Shape control, 130 Shape object, 509 Shared attribute, 245–46 shared method, 277 Shdocvw.dll, 326 Short data type, 233, 234, 252 for 16-bit numbers, 92 upgrading Integer to, 143, 144 Short keyword, 37 shortcuts for arithmetic operators, 12 Show method, 389 ShowDetail subroutine, 228–29 simple binding, 317 simple component wrappers, 293 Simple Remoting example, 453 Simple Web Service sample, 441 SimpleClass type in the Simple Remoting example, 453, 454 SimpleService.asmx.vb file, 442 SimpleTransaction, 360–61 single threading, 29 single-use class attribute, 146 single-use classes, changing to public, 165 Size property, 268 SizeConst attribute with Marshal As, 260 Slider ActiveX control, mapping, 413 Small Fonts font, 210 snappy graphics form in DynamicApp, 386 Sn.exe tool, 357 snippets, 98–99

SOAP

541

SOAP, 423, 441 SOAP applications, XML Web services as a framework for developing, 441 SOAP Services, 349 attribute, 463 example, 462 limitations of, 462 publishing COM+ applications through, 461–63 SOAP Toolkit, XML Web services as an alternative to, 441 SoapServicesText class in the SOAP Services example, 462–63 soft binding, 69, 72, 206, 372–73 Solution Explorer, 85, 92, 104 solution file, 85 solutions, 94, 104 “Specified cast is not valid” exception, 245 splash screen, added by VB Application Wizard, 376 spreadsheet, loading upgrade report issues into, 157–58 SQL Server databases, fast access to, 53 SqlClient namespace, 425, 432 SqlClient providers, 421 SqlConnection object, 421 SqlDataAdapter, 420 SqlDataReader class, 53 Sqrt function, 141–42 SSTab ActiveX control, 139 mapping to Visual Basic .NET, 413 upgrading with a .NET Windows TabControl, 287 on a Windows form, 287 stand-alone applications, 57 standard drag and drop. See drag-and-drop operations Standard EXE project type, 122, 365, 366 standard form layouts, 14 standard references, 111 standardization as a justification for upgrading, 52 startup form for MDI forms, 282 in Visual Basic .NET, 278 startup object, ending applications, 165 Startup Object list, 279 startup scenarios for Visual Basic applications, 209 state of an application, 324 statement attributes, 36 statement “is not supported” upgrade issue, 160 statements the .NET Framework, 268–69 mapping Visual Basic 6 to equivalent .NET functions, 515–20 new in Visual Basic .NET, 223 static subroutines, 223 StatusBar ActiveX control, 413 StdOle2.tlb, 301–2

stepping through Visual Basic 6 code, 184 stream objects, 390 strict data types, 70–71 strict type coercion, 18 strict type conversion, 36 “A string cannot be used to index the <variablename> control collection” upgrade issue, 162 string comparison mode, 89 string concatenation, 53–54 string concatenation operator, 73 string parameters, marshaling as ANSI strings, 259 StringBuilder class, 53–54 StringIsFixedLength parameter, 237 strings with an odd-number of bytes, 163 passing to Windows API functions, 253 storage of, 345 StringToRs function, 424 strong name, creating for an assembly, 356, 357 Strong Name tool, 357 strongly typed arrays, 242, 245 strongly typed variables, 69, 72 StrPtr function, 63, 261–62 eliminating, 343–45 not supported in Visual Basic .NET, 261–63 upgrade issue generated by, 160 StructLayout attribute, 259 Structure keyword, 36, 153 structure member, declaring as a Char array, 260 structured error handling, 37 structured exception handling, 11, 223 Structure...End Structure, 223, 245 structures, 245–49 Sub Main, ending applications, 165 Sub Main event, 377 Sub Main method as a startup object, 209 “Sub Main won’t be called at component startup” upgrade warning, 165 Sub New constructor, 277 subobjects, 293 subroutines, 36–38 subroutine calls, 37, 38 subscopes, 41 synchronization, 349 Synchronization attribute, 354 synchronization problems with threads, 249–51 SyncLock blocks, 251 SyncLock keyword, 37, 223, 251 syntax of Visual Basic .NET vs. Visual Basic 6, 4 System font, 210 System types, 21 System.Array class, 242, 244 System.Array type, 301

542

System.Convert class

System.Convert class, 141, 294 System.Convert methods, 295 System.DBNull.Value object, 165, 240 System.Diagnostics namespace, 112–13 System.Drawing.Color .NET type, 291 System.Drawing.Color values, 227 System.Drawing.Color.Red object assigning to the ForeColor property, 294 displaying the definition of, 225 System.Drawing.ColorTranslator methods, 295 System.Drawing.Font .NET type, 291 System.Drawing.Graphics class, 268 System.Drawing.Graphics object, 270 System.Drawing.Image .NET type, 290–91 System.Drawing.Point object, 268 System.Drawing.Printing namespace, 339 System.EnterpriseServices namespace, 350 System.IntPtr pointer type, 261 System.IO namespace, 387–88 System.IO.Directory.GetFiles method, 387 System.IO.Path.GetDirectoryName method, 388 System.IO.Path.GetFileName method, 388 System.Object, ToString method defined by, 202 System.Reflection.Assemble.GetExecutingAssembly method, 388 System.Runtime.InteropServices namespace, 258 System.Threading.Thread.CurrentThread.Sleep method, 395 System.UInt32 type, 293, 302 System.Web.UI namespace, 431 System.Windows.Forms.Application.Run method, 209 System.Windows.Forms.Button, 475 System.Windows.Forms.Checkbox, 469 System.Windows.Forms.CheckedListBox, 496 System.Windows.Forms.Clipboard namespace, 331–33 System.Windows.Forms.ComboBox, 472 System.Windows.Forms.Form upgrading Form to, 484 upgrading MDIForm to, 499 System.Windows.Forms.GroupBox, upgrading Frame to, 488 System.Windows.Forms.HScrollBar, 490 System.Windows.Forms.Label upgrading Label to, 493 upgrading Line to, 495 upgrading Shape to, 509 System.Windows.Forms.ListBox, 496 System.Windows.Forms.MenuItem, upgrading Menu to, 502 System.Windows.Forms.Panel upgrading Frame to, 488 upgrading PictureBox to, 505 System.Windows.Forms.PictureBox upgrading Image to, 491 upgrading PictureBox to, 505

System.Windows.Forms.RadioButton, upgrading OptionButton to, 502 System.Windows.Forms.TextBox, 510 System.Windows.Forms.Timer, 513 System.Windows.Forms.VScrollBar, 513

T
tab index number, 33, 34 Tab Layout Editor, 33–34 tab ordering, 33–34 TabControl in Windows Forms, 139 TabStrip ActiveX control, 413 Task List, 109–10 background, 16 customizing what is displayed in, 109–10 filtering for upgrade warnings, 91 TCP/IP, 452 technologies as a factor in upgrading, 57–58 template class, 192 Terminal font, 210 test page, creating for an XML Web service, 443–44 text changing alignment for selected text inside a control, 373 printing into forms in GDI+, 331 printing semitransparently, 397 Text property passing, 173 replacing Caption, 267 TextBox adding dynamically at run time, 333, 334 adding to a ListBox control, 202–3 adding to a Windows Forms project, 104, 105 upgrading, 130 upgrading properties, methods, and events of, 510–12 TextHeight statement, 271 TextWidth statement, 271 thread-safe code, 249–51 thread synchronization block, 37 threading model, 29 Throw keyword, 37 tightly coupled applications, 436 time, estimated for fixing upgraded projects, 157–58 time of upgrade in the upgrade report, 155, 156 timer, enabling on a form, 397 Timer control, 130 Timer Interval property, Help topic for, 87 Timer object, upgrading properties and events of, 513 “Timer property .Interval cannot have a value of 0” upgrade warning, 167 ToDo comments, 16, 154. See also Upgrade ToDos ToDo EWIs. See Upgrade ToDos Toolbar ActiveX control, 413

Toolbox

543

Toolbox Visual Basic 6 vs. Visual Basic .NET, 31–32 in the Visual Basic .NET IDE, 103, 104 ToOle function, 294 ToOle method, 226 top level scope, moving variable declarations to, 41 Top property, setting with Location, 267–68 ToString method, 201–3 Trace class, 112–13 Transaction attribute, 354, 355, 360–63 transactions, explicitly committing or aborting, 363 TranslatorClient sample application, 178, 179 TranslatorServer project calling the .NET version, 187 creating and running, 178–80 upgrading to Visual Basic .NET, 185–86 transparent controls, not supported by Windows Forms, 129 transparent labels, 288 TreeView control adding a single parent and child node to, 414–15 Anchor property of, 394 applying the Ax wrapper to, 293 mapping to Visual Basic .NET, 413 structure of, 414 subobjects exposed by, 293 troubleshooting link in the upgrade report, 155, 157 TrueType fonts, 209, 210, 211 Try keyword, 37 Try...Catch error trapping, 312–13 Try...Catch statement, 223 Try...Catch...End Try exception-handling block, 11 twips, 329 two-pass upgrade, 160 type aliasing, 301–2 type-casting function, 40 type checking, 13 Type class, returning, 36 type conversion functions, 41 type conversions, exceptions requiring, 295–96 type declaration, 36, 74 type identity, 25–28 Type keyword, 153 type mismatch assignments in upgraded code, 295–96 type names, fully qualifying, 26 Type...End Type, 223, 245 types, 238–49, 388 converting between in Visual Basic .NET code, 141 listing all in the current application, 388–89 qualifying ambiguous, 27

U
UInt32 color value, 294 UInt32 type, 293 “Unable to determine which constant to upgrade to” upgrade issue, 161 “Uncomment and change the following line to return the collection enumerator”, 163 underlying data types, 67–68 underlying integer values for constants, 66–67 undetected errors, 172–74 undocumented functions, supported in Visual Basic 6, 343 Unicode keyword, 36 unified debugger, 16 unified framework, 6 universal forms package, 35 Unload event, 162 “Unload <object> was not upgraded” upgrade issue, 162 UnloadMode for QueryUnload, 162 Unlock statement, mapping, 232 unmanaged code, 46 Unmanaged Code Debugging option, 183 unqualified parameters, upgrading and qualifying, 144 unqualified variable declarations, 143 Update Controls option, 50 UpDown control, 139–40 mapping to Visual Basic .NET, 413 upgrading to .NET Framework UpDown control, 288 upgrade, performing a two-pass, 160 UPGRADE_ comments for code-behind forms, 145 upgrade form file, 407 upgrade issues, 152 across forms, controls, and components, 267–74 generated by the Upgrade Wizard, 142 listing of, 160–63 upgrade log, loading into Excel, 157–58 upgrade notes, 155, 170–71 upgrade options, 45–47 upgrade plan, developing, 58 upgrade problems, 199–222 upgrade process, 9, 10, 79–84 upgrade report, 93–94, 134–35, 155–57 generating for problem identification, 160 parts of, 155, 156–57 produced by the Upgrade Wizard, 48 upgrade settings in, 155, 157 Upgrade ToDos, 153–54, 163 upgrade warnings, 71, 164–67 upgrade with interoperability option, 47

544

Upgrade Wizard

Upgrade Wizard approach to upgrading, 117 choosing a project type and setting options, 82–83 code changes by, 88–92 COM interop and, 176 detecting name conflicts, 297 dynamic arrays and, 235–36 errors not detected by, 172–74 errors, warnings, and issues generated by, 149–74 features handled but not recommended, 62 features not handled by, 63 font translation during the upgrade process, 209–11 goals for, 117–18 items not upgraded or only partially supported, 121 methodology of, 119–28 role of, 48–49 running, 119 specifying a destination directory, 83–84 underlying constant values and, 67 upgrading Visual Basic 6 components, 190–91 warnings inserted by, 87, 91 welcome information, 81–82 working with an underlying constant, 212–13 upgraded applications, testing thoroughly, 49 upgraded code, compared to original Visual Basic 6 code, 88–92 upgraded components, controlling the binary compatibility of, 195 upgraded event code, 90–92 upgraded projects running, 85 specifying destination directories for, 83–84 UPGRADE_ISSUE comments, 118, 303 UPGRADE_ISSUE messages, 142, 152 _UpgradeReport.htm file, 93, 134 UpgradeSupport.vb module, 310 UPGRADE_TODO messages, 142, 153 UPGRADE_WARNING message, 150, 151, 154. See also EWIs upgrading evaluating the benefits of, 51–55 overview of options, 45–59 philosophy of, 117–18 physical factors determining, 55–58 preparing projects for, 61–76 reasons for, 10–16 selecting projects for, 50–58 steps involved in, 10 using the command line, 99–100 “Use of Null/IsNull detected” upgrade warning, 165 user controls, 145–46, 340 user-creatable COM+ applications, 347–48 user-defined types, 238, 245 assigning the contents of one to another, 247

fixed-length arrays not supported in Visual Basic .NET, 246 passing to API functions, 258–60 UserControl project, 122 UserControls, threading issues with upgrading, 249 Users property of the Registry object, 394

V
“Value for property could not be resolved” upgrade warning, 166 variable declarations moving to the top-level scope, 41 not supported in Visual Basic .NET, 161 variable-length strings, header information associated with, 234 variable types determining for unqualified variable declarations, 143 not explicitly declaring, 64 variables declaring explicitly, 89, 143 declaring with As New, 207 deterministic lifespan of, 22 indeterministic lifespan of, 22 passing as parameters to functions, 172–73 redimensioning, 173 specifying explicitly, 69 storage of, 345 visibility of those declared in nested scopes, 41 Variant data type, 64, 238 eliminated in Visual Basic .NET, 40 in late binding, 70 mapping to a .NET object type, 292 not used in early binding, 69 replaced by Object, 238 upgrading properties of, 149–51 upgrading to Object, 143–44 VARIANT_BOOL parameter, 258 variants. See Variant data type VarPtr function, 62, 63 eliminating, 343–45 upgrade issue generated by, 160 VB Application Wizard replacing the LoadResStrings method generated by, 379–81 starting from the New Project dialog box, 365–66 upgrading projects created with, 365–81 .vb file extension, 90, 104, 127 VB Snippet Upgrade add-in, 98–99 VB6_AddADODataBinding method, 317 VB6.exe, 29 VB6_RemoveADODataBinding method, 317 VBFixedArray attribute, 246 VBFixedLengthString class, 40

VBFixedString attribute

545

VBFixedString attribute, 260 vbNullString, 314 .vbproj files, 127 VBUpgrade.exe, 99–100 VbVarType.vbDataObject, 161 VBX components, migrating to ActiveX, 285 VBX controls, 403 version 1 server component, 189 version 2 component, 189 version number in Visual Basic 6, 126–27, 367 in Visual Basic .NET, 127, 368 versioning improving by upgrading ActiveX controls, 404–5 properties, 369 visibility of variables declared in nested scopes, 41 Visual Basic additions to, in Visual Basic .NET, 35–41 fixing, 7 history of, 4–6, 265 improvements to, 7–8 language features not recommended for use, 62–63 modernizing, 8 upgrading from earlier versions of, 49–50 Visual Basic 1.0, 4, 5 Visual Basic 2 and 3, 4 Visual Basic 3, 285 Visual Basic 4, 4–5 Visual Basic 5, 49–50, 169 Visual Basic 5 and 6, 5 Visual Basic 6 accessing the registry, 392 add-in components, 288–89 associating events by name, 38 automatic dereferencing, 204 changing code for the Visual Studio .NET debugger, 182–84 as a closed environment, 21 coding practices, good, 64–76 collections, 299–300 compared to Visual Basic .NET, 19–43 components, 190–91 controls, 213–14 data binding in, 316–17 debugger, 188 differences from Visual Basic .NET, 4 drag-and-drop operations, 213–15 features, 57–58 form file, 407 graphics model, 57, 58 installing on the same machine with Visual Basic .NET, 79 interfaces for ActiveX controls, 288 leaving applications in, 45–46

managing name conflicts, 297 Menu Editor, 30–31 options for debugging using Visual Studio .NET, 182–83 runtime, 21 server, 184–87 snippets, 98 sourced projects, 9 stepping through code, 184 string concatenation in, 53 thread safety in, 249 Toolbox, 31–32 upgrading code, 140–45 upgrading projects to Visual Basic .NET, 3 Visual Basic 7, 19 Visual Basic Class Builder utility, 219 Visual Basic drag and drop, 269, 273–74 Visual Basic extension. See VBX controls Visual Basic forms, replaced by Windows Forms, 14 Visual Basic .NET, 3. See also .NET Framework adding and removing intrinsic controls, 334 ADO data environment not supported, 315 attributes, 352–56 backward compatibility of, 3 case sensitivity of, 17 changes in, 8–10, 17–18 changes in upgraded code, 37–41 circles, drawing in, 329 COM+ requirements in, 350–51 COM+ services in, 348–50 compared to C#, 16–18 compared to Visual Basic 6, 3–6, 8–9, 19–43 construction in, 75–76 control arrays in, 135 creating a project, 102, 103 debugger, 42 debugging in, 107–8 development of, 19 distributed technologies in, 440 drag-and-drop operations in, 215–19 enabling binary compatibility in classes, 191–95 explicit declaration of objects, 76 forms package in, 265 functions, 515–20 guide to working in, 101–12 IDE, 101–2, 108–12 installing on the same machine with Visual Basic 6, 79 lack of support for certain Visual Basic 6 features, 120 manipulating the Clipboard, 331–33 memory management through garbage collection, 204 module methods not supported, 310 new language features, 10–13

546

Visual Basic .NET

Visual Basic .NET (continued) no synchronization of threads for components, 249 null propagation not supported, 241 OLE Container controls not supported, 324 project types, 103 reasons to upgrade to, 51–55 server, 185–86 setting the startup form in, 278 subroutines associating with events by including the Handles clause, 38 support for the latest technologies, 270 Upgrade Wizard approach to upgrading, 117 using the Visual Basic 6 Collection object, 300 versioning in, 369 Visual Basic .NET compatibility library. See compatibility library Visual Basic OLE drag and drop. See OLE drag and drop Visual Basic Web site, 99, 122 Visual C++, 21 visual inheritance, 10, 14 Visual Studio 6, 29 Visual Studio .NET, 15–16 built on COM interop, 176 common elements of, 29 creating a .NET client, 180 debugger, 42, 182–84, 188 IDE, 29 locking source files during debug sessions, 107 Options dialog box, 110 Property Browser, 32 Tab Layout Editor, 33–34 Toolbox, 31–32 VScrollBar control, 130 VScrollBar object, 513–14

W
Wait parameter of AppActivate, 167 WaitForPendingFinalizers method, 25, 206 walkthrough of the upgrade process, 79–84 warnings inserted by the Upgrade Wizard, 87, 91 weak named assemblies, 28 Web applications, separate forms package for, 35 Web Browser control, 130 Web Browser form, created by VB Application Wizard, 378 Web development capabilities in Visual Basic 6, 5 Web development enhancements in Visual Basic .NET, 15 Web Forms controls, data binding with, 431 Web Forms package, 34 Web Forms presentation layer, 15 Web references, 111, 112, 445

Web Service Tester project, 445–46 Web services, 15 enabling applications to consume, 112 exposing functions as, 189 Web Services and ADODB sample, 448 WebBrowser ActiveX control, 325–26 WebClass-based projects, 122 WebClass designer, 289 WebClass project, 122 WebClasses, 5 WebMethod attribute, 441–42 WFW (Windows Forms Wrapper), 290 When keyword, 37 While...Wend, 223 Width property, 268 Width # statement, 232 Win32 declared functions, 57–58 Window RAD, 4 windowless controls, 287–88 Windows API, calling functions from, 251–63 Windows API functions calling DDE-related, 273 calling directly, 252 passing user-defined types to, 258–60 Windows application, creating, 104–5 Windows application architectures, 56–57 Windows Clipboard, 331–33 Windows Common controls, licenses for, 169 Windows Common Controls TreeView control, 334 Windows Form Designer Generated Code hidden block, 131 Windows Forms, 13, 14–15, 34–35 DAO and RDO data binding not supported, 307 default font, 169 development features in, 14 equivalents for Visual Basic 6 intrinsic controls, 128 fonts supported in, 168–69 indexing of controls, 334 list of ActiveX controls and components not supported, 286–87 NumericUpDown controls, 140 similarities with Ruby, 265–67 transparent controls not supported by, 129 windowless controls not supported in, 288 Windows Forms controls, 403 binding data to, 137 compared to ActiveX controls, 413–16 data binding to, 430–31 inherent advantages in the .NET environment, 404 renaming, 410 replacing ActiveX controls with, 405–6 table of replacements for ActiveX controls, 412–13 updating, 404–5 Windows Forms project, 104

Windows Forms TabControl

547

Windows Forms TabControl, 139 Windows Forms Wrapper (WFW), 290 Windows versioning, 369 Windows XP-style controls, 398–400 WinSock control, 297 wizard. See Upgrade Wizard WM_GETTEXTLENGTH message, 253 WM_SETTEXT message, 253 Word document displayed in an OLE Container control, 324 displayed with a WebBrowser control, 326 wrapper, implementing Web services as a, 446 wrapper class, writing code for controls against, 289 Write function, 232 Write # statement, mapping, 232, 233 WriteLine function, 232 WriteOnly keyword, 37 WriteProperties event, 146

XML over HTTP, 453 serializing objects to and from, 424 storing values in editable files, 391 support for, 15 support for ADO Recordset objects, 447–48 XML log file, upgrade report based on, 157 XML Web service client, 444–46 XML Web service proxy, 450 XML Web services, 440–51 ADO with, 423–25 implementing, 441–46 improving legacy systems, 57 restrictions on parameters and return values for, 442 supporting in existing applications, 446–51 testing, 443–44 XPTheme sample, 398

X
XA interoperability, 349 XCopy deployment, 400–401

Z
zero-bound lower dimension for arrays, 39–40


								
To top