Presentation is loading. Please wait.

Presentation is loading. Please wait.

VB6 Migration to.NET Sean Puffett Developer & Platform Group Microsoft Ltd

Similar presentations


Presentation on theme: "VB6 Migration to.NET Sean Puffett Developer & Platform Group Microsoft Ltd"— Presentation transcript:

1 VB6 Migration to.NET Sean Puffett Developer & Platform Group Microsoft Ltd seanpuff@microsoft.com

2 Agenda Mobile Data and Smart Device Applications Migration strategies Making use of existing code Migration Tools Amplify the application with.NET features

3 Mobile Data & Smart Device Apps

4 Migration Strategies Get some experience with.NET Look at.NET Application Architectures Target a few, small applications Inventory and evaluate applications to find the most suitable Migrate one piece of an application at a time Horizontal slice UI or Middle Tier Vertical slice Mortgage application process New feature development

5 Migration Strategies Migrate one piece of an application at a time Maximise benefits from.NET E.g. ASP->ASP.NET performance gains E.g. VB Forms->Windows Forms deployment gains Re-use existing code where appropriate Avoid “polluting” a.NET architecture with non.NET technologies Write wrappers if necessary to avoid this Good example would be ADO Recordsets

6 .NET Application Architectures Taken from MSDN Patterns & PracticesMSDN Patterns & Practices

7 Agenda Mobile Data and Smart Device Applications Migration strategies Working with existing code Migration Tools Amplify the application with.NET features

8 Working with Existing Code Mainstream.NET programming provides 2 ways to reach existing code Platform Invoke (P/Invoke) Allows.NET code to call out to functions exported from DLLs Allowing for call backs into.NET code COM Interop Exposes COM objects as.NET objects Exposes.NET objects as COM objects Take care with STA threading models

9 Using COM From.NET Runtime Callable Wrapper Common Language Runtime IFooIUnknownComServer Client Reference Counted Object

10 .NET from COM IFoo IDispatchIUnknown COM Callable Wrapper Server IFoo Common Language Runtime Client COM Client

11 Working with existing code

12 Agenda Mobile Data and Smart Device Applications Migration strategies Making use of existing code Migration Tools Amplify the application with.NET features

13 Tools help migration VB6 Application VB6 VB6 VB.NET Prepare for upgrade VB6 Code Advisor VB6 Code Advisor Upgrade and fix issues Migration Wizard Enhance with new features VB6 VB6 VB6

14 Prepare VB6 code Strongly type variables Null Propagation Non zero lower bound arrays Replace values with Enums Incompatible properties Module methods

15 “Code Advisor” a.k.a “FixIt” Configuration HTML summary Extending the “Code Advisor” Dim prpObj As Property 'FIXIT: Declare 'vTmp' with an early-bound data type FixIT90210ae-R1672-R1B8ZE Dim vTmp As Variant 'FIXIT: Declare 'vNew' with an early-bound data type FixIT90210ae-R1672-R1B8ZE Dim vNew As Variant Dim frmProp As New frmProperty Dim prpObj As Property 'FIXIT: Declare 'vTmp' with an early-bound data type FixIT90210ae-R1672-R1B8ZE Dim vTmp As Variant 'FIXIT: Declare 'vNew' with an early-bound data type FixIT90210ae-R1672-R1B8ZE Dim vNew As Variant Dim frmProp As New frmProperty

16 Code Advisor for VB 6

17 Before Migration Wizard Must be able to compile VB6 app Must have design time license files Must have all referenced components (required for Interop assemblies) Should remove unused references, particularly for ActiveX controls

18 Migration Wizard EXE & DLL Copies project Creates reports Links to Help Four Levels IssueNo Automatic Upgrade ToDoRequires Finishing WarningPossible Behavior Change NoteInformational

19 Migration Wizard Form Layout ActiveX Controls ADO Data Binding Code Syntax Changes COM Libraries RES files Behavior warnings

20 Micro Issues are 80% Simple to fix. Create “Noise” Five issues represent 88% of all upgrade issues Default properties52% Property/method not upgraded13% Property/method different behavior12% Module methods of COM objects7% Null/IsNull4%

21 VisualBasic.dll Collection Collection Constants ( vbCancel, vbCrLf… Constants ( vbCancel, vbCrLf… ControlChars ( CrLf, Tab,… ControlChars ( CrLf, Tab,… DateAndTime ( DateAdd… DateAndTime ( DateAdd… ErrObject ErrObject FileSystem FileSystem Information ( IsDate, IsDBNull, … Information ( IsDate, IsDBNull, … VBMath VBMath

22 VisualBasic.Compatibility.dll Class DirListBoxEx Inherits Microsoft.VisualBasic.Compatibility.VB6.DirListBox End Class Class DirListBoxEx Inherits Microsoft.VisualBasic.Compatibility.VB6.DirListBox End Class Caution: Functions in the Visual Basic 6.0 Compatibility library are provided only for use by the upgrading tools. Although it is possible to use this library when writing new code, there is no guarantee that it will be supported in future versions of Visual Basic.

23 Migration & Snippet Wizard

24 Agenda Mobile Data and Smart Device Applications Migration strategies Making use of existing code Migration Tools Amplify the application with.NET features

25 Amplifying the Application Look at smart client applications Make best use of the client device Desktop, TabletPC, PDA, Phone Online/offline capabilities Intelligent deployment and update capabilities Web-service communication with back-end services Look at Service Oriented Architectures With ASP.NET web services and Web Service Enhancements Replace ADO data access with ADO.NET

26 The slides for this event will be posted at: www.microsoft.com/uk/msdn/postevents

27 MSDN Connection Get personalised info and a customised RSS feed The programming language(s) you’re interested in The technology area(s) you’re interested in The information you want View news, technical resources, events, webcasts and community information Sign up for MSDN Connection at: http://www.microsoft.com/uk/msdn

28 Resources Migrating Visual Basic 6 to.NET Migrating ASP to ASP.NET Visual Basic 6.0 Code Advisor ASP.NET Migration Assistant Upgrading to Microsoft.NET on GotDotNet Upgrading to.NET on MSDN.NET/COM Interoperability.NET Migration Case Study

29 © 2003-2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "VB6 Migration to.NET Sean Puffett Developer & Platform Group Microsoft Ltd"

Similar presentations


Ads by Google