22
Migrating VB 6 Applications to VB .Net Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Embed Size (px)

Citation preview

Page 1: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Migrating VB 6 Applications to VB .Net

Nilotpal BhattacharyaPartner Technical Consultant| Microsoft

Page 2: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Agenda

►Why VB .NET?►Migration Decision Framework►Migration Strategies►Migration Tools►Demos

Page 3: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

► Move towards Object Orientation► Many great language features► Better and powerful IDE► Awesome XML support► Disconnected data architecture► Web programming support► Easy deployment► Plenty of resources and full support

Why VB .NET?

Page 4: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Rewrite Migrate

Replace/Partner

Reuse

Application Quality

Ap

pli

cati

on

TY

pe Custom

Standard

HighLow

Migration Decision Framework

Page 5: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Migration Strategies

Client Tier

Business Tier

Data Tier

Component vs. Horizontal vs. Vertical Migration

Horizontal

Com InteropComponent

Vertical

Form

In

tero

p

Page 6: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Using COM from .NET

Page 7: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Potential issues with RCW

►Object RuntimeComponents that assume deterministic finalization may “leak” resourcesDestrcutors or Class_Terminate events will not execute untill the object is being collected

Marshalling TypesCustom marshalling/serlialization of complex types may be required

Try to expose simple types (string, integers, dates when possible

Page 8: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Runtime Callable Wrapper

DEMO

Page 9: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Using .NET from COM

Page 10: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Restrictions with CCW

Classes must have a default constructor (One that takes no parameter)Classes cannot expose shared methodsClasses cannot expose overloaded methods

Note: If you expose overloaded methods, then you’ll get non descriptive names in the CCW (e.g Hello and Hello_2

Page 11: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Using .Net from COM

DEMO

Page 12: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Interop Forms Toolkit 2.0Reduce risks by moving one form at a time instead of entire modules or tiersExtend existing VB Forms with VB .Net ControlsProvides guidance, tools and code to make phased upgrade easierNot a code converterVB 6 Application

VB6 Form(s)Com Interop

VB .NET Form(s)

Page 13: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Features in v2.0

Interop UserControlsNet Controls that look and feel like ActiveX controlsExtend VB6 apps within the same formCan be placed in MDI

Easy DeploymentRedistributableRegFree COM SupportMore Documentation

Page 14: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Interop ToolKit v2.0

DEMO

Page 15: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

►Code AdvisorAdd-in for VB6Review code against pre-determined standardsIdentify migration issues

►Upgrade Assessment toolFile Dependency and Call graphsEstimates of cost and effort to migrateOther potential migration issues

MigrationTools

Page 16: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

►EXE & DLL►Copies project►Creates reports► Links to Help► Four Levels

Issue No Automatic UpgradeToDo Requires Finishing Warning Possible Behavior ChangeNote Informational

MigrationMigration Wizard

Page 18: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

► Install Visual Basic 6.0 on the computer that you will be using for upgrading.

►Windows Forms is largely compatible barring few differences like► Non compatible Clipboard statements ► No support for the Name property for forms

and controls at run time► Setting 0 in Timer control to disable the

Timer.►Get an estimate by running Upgrade

Wizard

Some Pointers for migration

Page 19: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

►Mainstream support ended March 31, 2005

7 years of free support is far longer than competitors

►Extended support is available through March 31, 2008. Custom support through 2012

► The VB6 Runtime is slated to ship as a part of Windows Vista

FAQ – VB Support policyHow much longer are you supporting VB6?

Page 20: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Resources

► “Upgrading VB6 to VB.NET” MS Press – FREE !http://msdn.microsoft.com/en-us/vbrun/ms788236.aspx

► Designing an Application Migration Strategy…http://msdn.microsoft.com/en-us/library/aa288720.aspx

► Upgrade Assessment tool and Upgrade guidehttp://msdn.microsoft.com/en-us/library/aa480541.aspx

► Preparing your Visual Basic 6 Applications for Upgrade

http://msdn.microsoft.com/en-us/library/aa260644.aspx

► Code Advisorhttp://www.microsoft.com/downloads/details.aspx?familyid=a656371a-b5c0-4d40-b015-0caa02634fae&displaylang=en

Page 21: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

Feedback / QnA

Your Feedback is Important!Please take a few moments to fill out our

online feedback form

Use the Question Manager on LiveMeeting to ask your questions now!

Page 22: Nilotpal Bhattacharya Partner Technical Consultant| Microsoft

© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.