Migration nach VB .NET Jens Häupel Developer Platform & Strategy Group

Slides:



Advertisements
Ähnliche Präsentationen
Cadastre for the 21st Century – The German Way
Advertisements

E-Solutions mySchoeller.com for Felix Schoeller Imaging
DNS-Resolver-Mechanismus
Kurt Rosenberg. C# für.NET oder.NET für C# is(C# == C++ && Java)? true : false ; reines C# Ausblick Überblick.
Microsoft Referenzarchitekturen- Infrastruktur für Connected Systems
Entwicklung und Einsatz von Smart Client-Anwendungen Jens Häupel Developer Evangelist Microsoft Deutschland GmbH Dirk Primbs.
Windows Vista Deployment
Windows Vista für Entwickler
Neue Mobilität Frank Prengel Developer Evangelist Developer Platform & Strategy Group Microsoft Deutschland GmbH
1. 2 Microsoft.NET Überblick Dirk Primbs Technologieberater Developer Platform & Strategy Group Microsoft Deutschland GmbH.
Web Matrix Project Kurzüberblick Dirk Primbs Technologieberater Developer Platform Strategy Group Microsoft Deutschland GmbH.
Herzlich Willkommen zum Informations-Forum: SAP Interoperabilität
.NET – Quo Vadis? Dariusz Parys Developer Group Microsoft GmbH.
WebCast: Managed Smart Tags mit VSTO Jens Häupel.NET Technologieberater Microsoft Deutschland GmbH
MSDN Webcast: VB.NET für Einsteiger und Umsteiger, Teil 10 Die erste, eigene Klassenbibliothek (Level 100) Presenter: Daniel Walzenbach Technologieberater.
Presenter: Daniel Walzenbach Technologieberater
Deutsche Gesellschaft für Technische Zusammenarbeit GmbH Integrated Experts as interface between technical cooperation and the private sector – An Example.
Frank Fischer Manager Evangelism and Marketing Microsoft Deutschland GmbH.
Gehärtet von Anfang an { Windows 2008: Spezielle Aufgaben }
Microsoft Office Forms Server
Windows Essential Business Server 2008
Institut AIFB, Universität Karlsruhe (TH) Forschungsuniversität gegründet 1825 Towards Automatic Composition of Processes based on Semantic.
Sanjay Patil Standards Architect – SAP AG April 2008
| DC-IAP/SVC3 | © Bosch Rexroth Pneumatics GmbH This document, as well as the data, specifications and other information set forth in.
Centre for Public Administration Research E-Government for European Cities Thomas Prorok
BAS5SE | Fachhochschule Hagenberg | Daniel Khan | S SPR5 MVC Plugin Development SPR6P.
3rd Review, Vienna, 16th of April 1999 SIT-MOON ESPRIT Project Nr Siemens AG Österreich Robotiker Technische Universität Wien Politecnico di Milano.
© All rights reserved. Zend Technologies, Inc. Jan Burkl System Engineer, Zend Technologies Zend Server im Cluster.
| Basel Von der SharePoint Taskliste zum gemanagten Project in Project Server Luca Argentiero Solution Specialist Microsoft
The free XML Editor for Windows COOKTOP Semistrukturierte Daten 1 Vortrag Semistrukturierte Daten 1 COOKTOP The free XML-Editor for Windows
Your name Bedeutung von Internet- Technologien Gruppe 1 Andreas Feuerstein Philipp Hochratner Christian Weinzinger.
Jan Hentschel Microsoft Expert Student Partner Windows Azure Windows Azure Windows Azure Mobile Services.
Swiss TechNet Events Herzlich Willkommen Windows Server alles Wichtige zum neuen Server-Betriebssystem von Microsoft – 4. Oktober 2012 Walter Pitrof,
Neno Loje Berater & MVP für Visual Studio ALM und TFS (ehemals VSTS) Hochqualitative Produkte mit Visual Studio & TFS 2010.
| Basel Developing apps for SharePoint 2013 using Visual Studio 2013 René Modery, Office 365 MVP, 1stQuad Solutions.
Dariusz Parys Developer Evangelist Microsoft Deutschland GmbH.
Swiss TechNet Events Herzlich Willkommen Windows 8 3. April 2013 Martin Weber, Technical Solution Professional Thomas Schindler, V-Technical Solution Professional.
Frank Fischer + Bernhard Frank Microsoft Deutschland GmbH.
Roger Boesch Developer Technical Specialist Developer and Platform Group.
TechNet Schweiz – Herzlich Willkommen System Center 2012 LIVE - Modernes Systems Management als Kernstück der Microsoft Private Cloud 28. März 2012 Walter.
Swiss TechNet Events Herzlich Willkommen Windows 8.1 Überblick & moderne Workplace Szenarien 25. November 2013 Martin Weber, Tech Solutions Professional,
Swiss TechNet Events Herzlich Willkommen Virtualisierung auf Basis von Windows Server 2012: von "on-premise" in die Cloud und zurück 15. Mai 2013 Michael.
Thomas Claudius Huber Senior Consultant Trivadis AG Silverlight 5 die Neuerungen.
Quelle: Standish Group, 2006 Fourth Quarter Research Report, CHAOS Research Results.
3/28/2017 8:11 PM Visual Studio Tools für Office { Rapid Application Development für Office } Jens Häupel Platform Strategy Manager Microsoft Deutschland.
Spricht Ihre Anwendung schon Open XML?
MVVM in Windows 8 und Windows Phone 8
TechNet Schweiz – Herzlich Willkommen Microsoft Forefront Identity Manager 2010 R2 - effektives und nachhaltiges IT Service Management 2. Dezember 2011.
Swiss TechNet Events Herzlich Willkommen Windows 8 9. Januar 2013 Daniel von Büren, Redtoo AG Andras Khan, Microsoft Schweiz Martin Weber, Microsoft Schweiz.
PresenterCompanyContact Windows Azure ASP.NET Web-Anwendungen schnell und zuverlässig bereitstellen.
TechNet Schweiz – Herzlich Willkommen Unified Communication: Neuigkeiten zu Exchange, Lync und Windows Phone November 2011 André Hagmann, Microsoft.
INTAKT- Interkulturelle Berufsfelderkundungen als ausbildungsbezogene Lerneinheiten in berufsqualifizierenden Auslandspraktika DE/10/LLP-LdV/TOI/
XML IV: Cocoon 2.
Virtual Earth Visualisierung von Geodaten Daniel Walzenbach, Microsoft Deutschland GmbH
Template v5 October 12, Copyright © Infor. All Rights Reserved.
Cyber-Security und Datenschutz in der Cloud Wie passt das zusammen?
TechNet Schweiz – Herzlich Willkommen Der moderne Business Desktop - Microsoft-Technologie für flexibles Arbeiten 1. März 2012 Martin Weber, Microsoft.
Ein Projekt des Technischen Jugendfreizeit- und Bildungsvereins (tjfbv) e.V. kommunizieren.de Blended Learning for people with disabilities.
Office Business Anwendungen mit SharePoint Fabian Moritz | MVP Office SharePoint Server.
Microsoft Cloud Day Herzlich willkommen!. Microsoft Cloud Day MSDN Veranstaltung Die Cloud Plattform als Erfolgsbaustein – Wie Sie als Softwarefirma von.
Die nächste Generation von Microsoft Office System 2007 Microsoft Office System Gernot Kühn Technologieberater Office System Mittelstandsbetreuung.
3rd Review, Vienna, 16th of April 1999 SIT-MOON ESPRIT Project Nr Siemens AG Österreich Robotiker Technische Universität Wien Politecnico di Milano.
Thomas Claudius Huber Senior Consultant Trivadis AG WCF RIA Services Datengetriebene Apps.
Launch ON Global.vi System ID object name classname Services to suscribe Observer Control Ref vi-path Service name Step 1 : Objects register to the Global.vi´s,
SQL Server 2005 CLR Integration Sebastian Weber Microsoft Deutschland GmbH
Technische Universität München 1 CADUI' June FUNDP Namur G B I The FUSE-System: an Integrated User Interface Design Environment Frank Lonczewski.
Martin Rink, SAP Trust Center Services SAP Trust Center Services SAP Passports - Scenarios of Usage.
Swiss TechNet Events Herzlich Willkommen Windows 8 – 24. Oktober 2012
Computer Services Business challenge
Azure Mobile Services Deep dive into node.js scripting
 Präsentation transkript:

Migration nach VB .NET Jens Häupel Developer Platform & Strategy Group Microsoft Deutschland GmbH jensha@microsoft.com

Top News - Was ist IN und was OUT Migration Agenda Top News - Was ist IN und was OUT Neuigkeiten, Änderungen Migration Bevor es losgeht Die Umstellung Technologien für den Teilupgrade Gegenüberstellung VB6 – VB .NET Performance Produktivität

Nein! VB .NET = VB6 + 1 = VB7? Neues Konzept, neue Basis Designed für .NET Framework CLR, Base Class Library Modernisierte und aufgeräumte Sprache Neue Sprachfeatures Komplett neue Architektur Komplett objektorientiert Nein!

VB .NET - Top News

Eine IDE für alle Projekte/Solutions Neues aus der IDE Eine IDE für alle Projekte/Solutions Web Development Desktop Development Mobile Development Start-Seite bietet Zugriff auf Projekte Online-Ressourcen Server Explorer SQL Server-Administration Zugriff auf System-Ressourcen

Eine IDE für alle .NET-Sprachen MyProfile Neues aus der IDE Eine IDE für alle .NET-Sprachen MyProfile Intelligente Code-Formatierung Regions Dynamische Hilfe Aufgabenbereich Syntaxfehler Benutzerdefinierte Kommentare

Visual Studio Installer Neues aus der IDE Klassenansicht Floating Windows XML Schema Designer Visual Studio Installer Custom Actions als .NET Code Benutzerdefinierte Dialoge Macro Explorer Integrierter Internet Explorer

Neue Features von VB .NET Überladung von Funktionen Verschiedene Signaturen Überschreiben von Funktionen Bsp: Ableiten von best. Control Dock / Anchor - Properties Protected Overrides Sub WndProc(ByRef msg As Message) ' Do something ' Finally: Pass message to default handler: MyBase.WndProc(msg) End Sub 2 Funktionen mit gleichem Namen und unterschiedlichen Parametern Sample zeigen mit TreeView, Splitter und Listview

Neue Features von VB .NET Einfach verbindend: WebServices ASP.NET – Code Behind Prinzip  no more Visual Interdev GDI+  Visuelle Effekte (Opacity) Leichtere Lokalisierung Visueller Menüeditor Menüeditor + programmatisches Erstellen von Menüs zeigen

Neue Features von VB .NET Common Type System Identische Typen für alle Sprachen Strukturierte Ausnahmebehandlung Try 'execute some code Catch ix As System.IO.FileLoadException 'Handle IO Exception Catch sx As System.Security.SecurityException 'Handle Security Exception Catch ex As System.Exception When Exp=True 'Handle general Exception Finally 'Execute this code always when Try block is being left End Try

Neue Features von VB .NET Attribute Multithreading Völlig neues Objektkonzept Vererbung Class Object: Die Mutter aller Objekte Visual Tab Order Editing Visual Tab Order Editing zeigen

Sprachliche Änderungen Array-Basis: 0 Private i, x, y As Integer i += 1, strName &= “Bob”, etc. For i As Integer = 0 To 10 ByRef / ByVal erforderlich Datentypen Byte : 8 Bit Integer : 16 Bit Long : 32 Bit in VB6 in VB .NET Byte : 8 Bit Short : 16 Bit Integer : 32 Bit Long : 64 Bit

DirListBox, FileListBox, DriveListBox CommonDialog Image Frame Ausgediente Controls Spinner Line und Shape DirListBox, FileListBox, DriveListBox CommonDialog Image Frame DomainUpDown, NumericUpDown System.Drawing Namespace OpenFileDialog, SaveFileDialog Color-, Font-, PageSetup-, PrintDialog PictureBox GroupBox, Panel KEY MESSAGE: A number of controls are also being replaced or retired altogether. SLIDE SCRIPT: [BUILD 1] The Spinner has been retired. Instead, you can use the DomainUpDown or NumericUpDown controls. [BUILD 2] There are no equivalents to the Line and Shape controls. For a simple horizontal or vertical line, you can use a Label control and then set its BackColor and Size properties appropriately. Or you can use the GDI+ classes in the System.Drawing namespace. [BUILD 3] Instead of the ListBox controls, you can use some of the new dialog boxes to achieve the same affect. [BUILD 4] The CommonDialog control has been replaced by six, more specialized controls: the ColorDialog, FontDialog, OpenFileDialog, SaveFileDialog, PageSetupDialog, and PrintDialog. [BUILD 5] The Image control has been replaced by the PictureBox. [BUILD 6] And the new GroupBox and Panel controls replace the Frame. Both of these are containers for other controls, but the Panel includes auto-scrolling.

Strengere Typüberprüfung = Knebelung des Programmierers? Implizite Konvertierung Dim d1 As Double Dim s1 As String s1 = "12,3" d1 = s1 12,3 oder 123 ? Option Strict On Vermeidet Programmierfehler Erzwingt explizite Konvertierung

Gruppieren verwandte Objekte Voll qualifizierte Namen für Objekte Namespaces Gruppieren verwandte Objekte FileIO, Security, WinForms, … Voll qualifizierte Namen für Objekte MyGraphicLib.Drawing.Pen vs. AnotherPersonsGraphicLib. Drawing.Pen Vermeiden Namenskonflikte Import von Namespaces Imports System.IO

Automatische Änderung der Variablenschreibweise im ganzen Code VB .NET vs. C# Case-Insensitiv Automatische Änderung der Variablenschreibweise im ganzen Code Optionale Parameter Intellisense Intelligente Formatierung Background-Kompilierung Syntax-Check während der Eingabe Aufgabenliste

Migration nach .NET - Bevor es losgeht

Alles umstellen, teilweise oder gar nicht Modular oder monolithisch? Vorüberlegungen Alles umstellen, teilweise oder gar nicht Modular oder monolithisch? Größe der Projekte Abgeschlossen oder in ständiger Weiterentwicklung Art der Projekte Verwendete Technologien und Sprachelemente Codequalität Punkte einzeln und ausführlich diskutieren

Welche Vorteile bringt die Umstellung? Auswahl / Bewertung Welche Vorteile bringt die Umstellung? Standardisierung auf einer Plattform Skalierbarkeit Verbesserung der Architektur Einfachere Weiterentwicklung Bessere Interoperabilität mit anderen Sprachen Neue Features, bessere Leistung Aufwand bewerten Schritte planen Punkte einzeln und ausführlich diskutieren Verbesserung der Architektur: Inheritance by Copying?  Zeiteinsparung bei Entwurf, Pflege und Wartung durch Inheritance und konsequente Objekthierarchien Neue Features, bessere Leistung: Sample StringSpeed zeigen: Unterschied zw. 'normaler' String-Verkettung und StringBuilder

Upgrade Überlegungen Nicht-upgradebare Technologien Technologie Empfehlung Visual Basic 6.0 drawing model In VB6 belassen oder in GDI+ neu DAO and RDO data binding Update nach ADO oder ADO.NET Dynamic Data Exchange (DDE) In VB6 belassen oder alternate Methode verwenden OLE Container Control In VB6 belassen Visual Basic 5.0 controls Upgrade nach Visual Basic 6.0 bzw. Danach nach Visual Basic .NET DHTML Applications Leave; can work with .NET Microsoft® ActiveX® Arbeitet über COM interop mit .NET Property pages UserControls In VB6 belassen - can work with .NET WebClasses KEY MESSAGE: There are numerous legacy technologies that are not supported or are not upgradeable. SLIDE SCRIPT: [BUILD 1] There are numerous legacy technologies that are not supported or are not upgradeable. In most cases, an application that makes heavy or core use of these technologies should be left in Visual Basic 6.0. This table lists the unsupported technology followed by an upgrade recommendation. Briefly highlighting each of these: the drawing model in .NET has been completely redesigned as GDI+, and does not translate at all from Visual Basic 6.0. An application that makes considerable use of the Visual Basic 6.0 drawing APIs, or the Shape and Line controls, will need to be left in Visual Basic 6.0 or rewritten for GDI+. Next, although DAO and RDO are accessible from .NET, data binding using these technologies is not supported. Therefore, any application that has controls bound directly to a local database—for example, one that has a Microsoft® Access back end—will need a lot of rework. DDE methods are not supported in .NET. Such applications should be left as-is. Either that or choose an alternative inter-application exchange technology prior to upgrading. OLE container controls and Property pages have no .NET support. DHTML applications, UserControls and WebClasses can be left in Visual Basic 6.0, because they will at least work with .NET. Certain ActiveX controls (SSTab and UpDown, for example), ActiveX document-based applications, and ActiveX EXE projects will either partially upgrade or not upgrade at all. These are generally left as-is, at least in the short term, and accessed using COM interop. Finally, Visual Basic 5.0 controls used within Visual Basic 6.0 applications should be updated to the Visual Basic 6.0 versions prior to upgrading to Visual Basic .NET. SLIDE TRANSITION: Assuming you make the decision to upgrade, what should inform your upgrade strategy?

Aufspalten in Teilprojekte Wie herangehen? Aufspalten in Teilprojekte COM Komponenten weiter verwenden  COM Interop Abhängigkeitshierarchie (Client  Middle Tier  Server) COM Interop COM .NET Server COM Interop .NET COM Middle Tier .NET Client .NET .NET

Migration: Vorbereitung Code vor dem Konvertieren analysieren Alte Konstrukte beseitigen DefInt, DefStr, Def*… GoTo, GoSub .. Return VarPtr, ObjPtr, StrPtr, Lset Option Base <> 0 Strings fester Länge Implizite Deklaration Private Sub Test() Variable1 = "Test" Variable1 = Varialbe1 & "-Lauf" Debug.Print Variable1 End Function

Migration: Vorbereitung Alte Konstrukte beseitigen Implizite Typkonvertierung Late Binding Werte für Konstanten Variants Me.MouseCursor = 3 Private Function Test(x, y) Test = x + y End Function

Migration: Vorbereitung Implizite Erstellung von Instanzen Dim c as MathLib.MyClass Set c = New MathLib.MyClass c.CallAMethod Set c = Nothing VB6 ' RunTime Error VB.NET bringt bei beiden Konstrukten einen Laufzeitfehler bzw. eine Exception Dim c as New MathLib.MyClass c.CallAMethod Set c = Nothing VB6 ' will execute

Migrationsanalyse in VB6 VB6 Code Advisor Migrationsanalyse in VB6 Download URL: http://www.microsoft.com/downloads/details.aspx?familyid=A656371A-B5C0-4D40-B015-0CAA02634FAE&displaylang=en Code Advisor zeigen

Migration nach .NET - Die Umstellung

VB .NET Upgrade Wizard VB6 und VB .NET installiert Ebenso: verwendete Controls Keine gegen- seitige Beeinflussung

Microsoft.VisualBasic.Compatibility VB .NET Upgrade Wizard Prinzipien Es ist Ihr Code! Struktur bleibt erhalten Kommentare ebenso Microsoft.VisualBasic.Compatibility

VB .NET Upgrade Wizard SLIDE SCRIPT: The best way to understand what goes on when you run the Upgrade Wizard is to examine the SDK upgrade documentation, the upgrade reports, and the Microsoft® Press® book Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET. However, a brief discussion of the methodology in some key areas will give you a high-level overview in preparation for the upcoming demonstration. [BUILD 1] In most cases, each file in a Visual Basic project retains its name. Only the file extension changes. Project files are converted from .vbp to .vbproj, and all other code files are changed to a .vb extension. The exception to this rule is when you have to code files with the same base name—for example, a Main.frm and a Main.bas, both of which should be converted to a Main.vb. In this case, one of the files is renamed with its internal class name. [BUILD 2] The only global objects that are even partially upgraded are App and Screen. Others, such as Printer and Clipboard, will need to be upgraded manually. [BUILD 3] Class modules and user controls upgrade to an equivalent class or user control in .NET. All of the class attributes upgrade to Public, except Private, which upgrades to Friend. [BUILD 4] Visual Basic 6.0 intrinsic controls are mapped to their .NET equivalents. Their associated layout and design-time property settings, preserved in a special section of the .frm file in Visual Basic 6.0, are mapped as closely as possible to .NET equivalents and written to the InitializeComponent subroutine of the new form. Only minor syntactical changes are made to control arrays, in order to target control array classes provided in the compatibility library. After the upgrade, you can convert these to intrinsic .NET controls collections. The general methodology with ActiveX controls is to continue using the exact same controls and references. You may encounter some behavioural differences, due to differences in the .NET and Visual Basic 6.0 ActiveX control hosting environments, mainly because of the introduction of a COM interop layer in .NET. In a few cases, an ActiveX control is upgraded to an equivalent .NET control. Other ActiveX controls are mapped to special controls provided in the compatibility library. [BUILD 5] ADO-based applications will upgrade with almost no changes. DAO and RDO-based applications will also continue to work in .NET, as long as you do not use data binding. ADO data binding continues to work just fine. The Data control is converted to an ADODC .NET control in the compatibility library. If you used a DataEnvironment designer in Visual Basic 6.0, the Upgrade Wizard will create a DataEnvironment class that encapsulates the design settings. [BUILD 6] Most of your code will be upgraded as-is, with no changes. The wizard uses a variety of means to do this. First, the majority of your code maps directly to a Visual Basic .NET language element of the same name. Some Visual Basic 6.0 elements that use incompatible types are mapped to a .NET statement with a slightly different name. For example, the Visual Basic 6.0 IsEmpty statement maps to IsNothing, because variants are no longer supported. In some cases, incompatible types are explicitly converted to the proper type. Related to this is the use of Option Explicit. This is turned on during the upgrade, and all undeclared variables are explicitly declared. As mentioned earlier, this requires that the wizard infer the type, which may not always be best. If possible, explicitly declare your variables before upgrading. SLIDE TRANSITION: A detailed report is generated automatically during the upgrade process.

Nach dem Auto-Upgrade UpgradeReport.htm Inline Kommentare Log File UpgradeSupport.VB Referenzen Alte COM Controls TypeLibraries Microsoft.VisualBasic.Compatibility

UpgradeReport

Code-Änderungen Kommentare im Code UPGRADE_ISSUE UPGRADE_TODO UPGRADE_WARNING UPGRADE_NOTE

UpgradeSupport.vb Friend-Objekte DAO, RDO, …

Upgrade Sample Demo: Upgrade eines VB6-Programmes

Verzichten auf die Compatibility Lib Keine ActiveX Controls Endziele Verzichten auf die Compatibility Lib .NET Befehle verwenden Keine ActiveX Controls .NET Controls einsetzen Keine Win32 APIs .NET Klassen verwenden

Visual Studio .NET IDE Tool Teilupgrade per Snippet Code Snippet Tool Visual Studio .NET IDE Tool Teilupgrade per Snippet Cut & Paste Type Code

Technologien für den Teilupgrade

Hello COM - .NET is calling COM Components in .NET .NET object COM object RCW IUnknown IDispatch KEY MESSAGE: COM interop. SLIDE BUILDS: 2 SLIDE SCRIPT: COM interop is a critical part of Microsoft’s .NET strategy. There are countless legacy COM components still in use today. It will be years before many of them will be ported to .NET, and some will never be ported at all. Therefore, it is very important that .NET applications and components interop with COM in as seamless a fashion as possible. [Build 1] Visual Basic .NET allows you to consume a COM component by wrapping it in a run-time callable wrapper (RCW). The wrapper makes the COM component look like a native .NET component. Creating the RCW is very easy in Visual Basic .NET. Simply add a reference to the COM component using the Add Reference dialog; Visual Studio .NET will automatically generate the wrapper for you. [Build 2] In addition to the ability to call COM from within .NET, you can also do the reverse. That is, you can call a .NET component from Visual Basic 6.0. This is also accomplished via a wrapper. This wrapper is called CCW or COM Callable Wrapper. SLIDE TRANSITION: When interopping with COM from .NET, there are a few things to consider. ADDITIONAL INFORMATION FOR PRESENTER: .NET Components in COM COM object CCW .NET object IUnknown IDispatch

COM in .NET Runtime Callable Wrapper (RCW) Erzeugen / Binden an COM Objekt Bedient COM Interfaces und übernimmt Transformation in managed Code Data Marshaling Lifetime Managment des COM Objekts COM HRESULT  .NET Exceptions Beachten Sie Datentypen (variants, ...) Primary Interop Assemblies (PIA) Deployment KEY MESSAGE: Using COM in .NET. SLIDE SCRIPT: [Build 1] The run-time callable wrapper (RCW) handles creating and binding to the underlying COM object. [Build 2] It consumes the COM interfaces and exposes them as managed .NET classes. COM and .NET data types aren’t necessarily the same. Sometimes they are, sometimes they aren’t. [Build 3] The RCW handles translating and marshaling the data. [Build 4] It manages the lifetime of the wrapped COM object. [Build 5] If the COM component exposes HRESULTs, it will translate them to .NET exception classes. [Build 6] Things to consider include the fact that .NET does not support the variant data type. [Build 7] A Primary Interop Assembly (PIA) is a special type of DLL that identifies the types that are deployed, versioned, and configured in a COM component as a single unit. It’s called ‘primary’ because only one interop assembly can be labeled the PIA. The PIA contains the official description of the types, as defined by the publisher of those types, and is always signed by the publisher. Any interop assembly that is not provided by the publisher of the COM types is considered unofficial and should be avoided. SLIDE TRANSITION: When interopping with .NET from COM, there are a few things to consider. ADDITIONAL INFORMATION FOR PRESENTER:

.NET in COM COM Callable Wrapper (CCW) Erzeugen / Binden an managed Objekt Simuliert COM interfaces (IUnknown and IDispatch) Data Marshaling Lifetime Managment der .NET Komponente .NET Exception  COM HRESULT Beachten Sie Datentypen (Variants, ...) Default constructor Deployment KEY MESSAGE: Using .NET in COM. SLIDE SCRIPT: The COM Callable Wrapper (CCW) does for COM what the RCW does for .NET. It allows .NET components, such as those created by Visual Basic .NET, to be used by Visual Basic 6.0. [Build 1] It handles creating and binding to the underlying managed object. [Build 2] It synthesizes the IUnknown and IDispatch COM interfaces based on the object's type information. [Build 3] It marshals and translates data and manages the lifetime of the .NET component. [Build 4] The CCW will translated .NET exceptions into COM HRESULT values. [Build 5] Look out for deployment issues. If you’re going to use a .NET component from Visual Basic 6.0, you still need to distribute the .NET Framework on each client PC. SLIDE TRANSITION: In addition to deployment issues, you also want to consider performance. ADDITIONAL INFORMATION FOR PRESENTER:

Upgrade von ActiveX Controls Einige Controls werden nicht supported Einige Controls wurden ersetzt in .NET Alle anderen per Wrapper-Klassen KEY MESSAGE: ActiveX control support in .NET. SLIDE SCRIPT: Most ActiveX controls are supported by Visual Basic .NET. There are some exceptions. Most notably, .NET does not support ActiveX container controls, windowless controls, or DAO databound controls. A container control is a control that serves as a container for other controls. For example, Visual Basic 6.0’s SSTab control is a container control. When the Upgrade Wizard upgrades a Visual Basic 6.0 form that contains the SSTab control, it replaces the ActiveX SSTab control with .NET’s native TabControl. But for most ActiveX controls, the Upgrade Wizard will simply create a wrapper class. The wrapper uses COM interop to serve as the translation layer between the ActiveX control and .NET. Once the wrapper is in place, the ActiveX control looks and acts as if it were a native .NET control. A.ocx Interop.AxA.DLL AxInterop.AxA.DLL Windows Form COM Interop Translation Extended properties

VB6 - VB .NET - Gegenüberstellung

Eventhandling in VB6 Ein Eventhandler für jedes Objekt

Eventhandling in VB .NET Eine Routine behandelt mehrere gleiche Events Handles-Klausel Signatur Sample

Menüs in VB .NET Wysiwyg Menü-Editor Eventhandler Sample Private Sub OnClickHandler(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles mnuProp.Click End Sub

Context-Menüs in VB .NET Anzeigen des Menüs Private Sub MouseUpHandler(ByVal sender As Object, _ ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles MyBase.MouseUp If e.Button = MouseButtons.Right Then ContextMenu1.Show(Me, New Drawing.Point(e.X, e.Y)) End If End Sub Eventhandler Sample Private Sub MenuOnClickHandler(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles mnuSendMail.Click Dim mnuItem As MenuItem = DirectCast(sender, MenuItem) ' Do something End Sub

File IO in VB6 4,2 s für 1000 Durchläufe

File IO in VB .NET 2,6 s 1,3 s für 1000 Durchläufe Traditionelle VB-Methode 2,6 s .NET-Methode Sample vorhanden, evtl. zeigen 1,3 s für 1000 Durchläufe

Drag & Drop DragEnter DragDrop MouseDown Source Control Target Control KEY MESSAGE: The key events involved with drag-and-drop operations. SLIDE SCRIPT: This animation represents, at a high level, the steps involved in implementing drag-and-drop. As you will see in the second demonstration, the methodology is the same whether the drag-and-drop is between TextBox controls, TreeView controls, or PictureBox controls (as is depicted here). When the animation begins, you will see event names in orange and key drag-and-drop language elements in white. [BUILD 1] The user initiates a drag-and-drop operation by clicking the mouse button over the image. This fires the MouseDown event, and the DoDragDrop method is invoked. As you will see, when working with a TreeView control, you could use the ItemDrag event instead. [BUILD 2] The mouse is then moved to the target control. Upon entering the target control, the DragEnter event fires and the drag drop Effect property is set based on the KeyState. Effect is the only writeable DragEventArgs property. In this example, assume the user did not press the control key, making this a move operation. The arrow represents the synchronous DoDragDrop method call. [BUILD 3] The user then releases the mouse button over the control, the DragDrop event fires, and the control receives the image by invoking the GetData method. The result of the drag operation is then returned to the DoDragDrop method. [BUILD 4] Finally, code in the MouseDown event checks to see if this is a move operation, and, if so, removes the image from the source control. SLIDE TRANSITION: It’s now time for the second demonstration, during which you’ll see this three-fold event pattern implemented in Visual Basic .NET. ADDITIONAL INFORMATION FOR PRESENTER: DragEnter e.Effect DragDrop e.Data.GetData() MouseDown DoDragDrop() DragDropResult

Drag & Drop Demo: Drag & Drop eines Bitmap

Globales Printer Object wird ersetzt durch: PrintDocument PrintDialog Drucken in VB.NET Globales Printer Object wird ersetzt durch: PrintDocument PrintDialog PrintPreview (sichtbar) PrintPreviewDialog MSDN: .NET Framework QuickStarts  .NET Samples - Windows Forms: Printing

Drucken: Prinzip PrintPage Event:

Win32 APIs bzw. Pinvoke Aufruf von unmanaged System Code Win32 APIs in VB6 Pinvoke in VB .NET Kein 'As Any' Type mehr in .NET !!

PInvoke (advanced) Attribute spezifizieren genauer

.NET Framework bieten Win32 API Funktionalität Leichter nutzbar als Win32 API Framework Class Library Beispiele System.Diagnostics System.Drawing System.Environment System.Win32 u.a.

ADO versus ADO.NET ADO ADO.NET ActiveX Data Objects Vielzahl von Datenquellen Connected und disconnected XML Support enthalten COM-basierend Native .NET Komponente Vielzahl von Datenquellen Entwickelt für ver-bindungslosen Zugriff Von vorn herein für XML entwickelt .NET-basierend

ADO versus ADO.NET Demo: Migration von ADO-Projekten

VB Resource Kit (im Web) Angebot VB Resource Kit (im Web) Special Offer: VB Res Kit + VS .NET Trial Version 60 Tage testen Sample Apps: WinForms, Web, Data Access, WebServices ComponentOne Studio Enterprise Free & Trial Components Tech. Infos zum Upgrade nach VB .NET Tools

… .NET rocks!

Ressourcen

Ressourcen VB @ MSDN http://msdn.microsoft.com/vbasic http://www.microsoft.com/germany/msdn/default.mspx GotDotNet: The Microsoft .NET Framework Community http://www.gotdotnet.com Bücher: http://www.microsoft.com/germany/ms/mspressnet/index.htm http://www.microsoft.com/mspress/books/index/6510.asp http://www.dotnetbooks.com/ http://www.kofler.cc/vbnet.html http://www.amazon.de/exec/obidos/search-handle-form/ref=sr_sp_go_as/028-7168974-2906165 Community http://www.microsoft.com/germany/ms/msdncommunity/ Newsgroups auf msnews.microsoft.com

For More Information… 101 Visual Basic Code Samples msdn.microsoft.com/vbasic/downloads/samples/ For Windows developers windowsforms.net (TaskVision) For Web developers www.asp.net (ASP.NET Starter Kits) Time Tracker Reporting eCommerce (IBuySpy store) Portal (IBuySpy portal) Community Upgrading msdn.microsoft.com/vbasic/techinfo/articles/ upgrade/

MSDN Essential Resources for Developers Subscription Services Library, OS, Professional, Enterprise, Universal Delivered via CD-ROM, DVD, Web Online Information MSDN Online, MSDN Flash, How-to Resources, Download Center Training and Events MSDN Webcasts, MSDN Online Seminars, Tech·Ed, PDC, Developer Days Print Publications MSDN Magazine MSDN News Membership Programs MSDN User Groups

How-to Resources Simple, Step-by-Step Procedures Embedded development How-to resources General How-to resources Integration How-to resources JScript .NET How-to resources Microsoft .NET development How-to resources Office development resources Security How-to resources Microsoft Visual Basic .NET How-to resources Microsoft Visual C# .NET How-to resources Microsoft Visual Studio .NET How-to resources Web development How-to resources (ASP, IIS, XML) Web services How-to resources Windows development How-to resources http://msdn.microsoft.com/howto

MSDN Webcasts Interactive, Live Online Events Interactive, synchronous, live online events Discuss the hottest topics from Microsoft Open and free for the general public Take place every Tuesday http://www.microsoft.com/usa/webcasts

MSDN Subscriptions The Way to Get Visual Studio .NET Enterprise Architect Software and data modeling Enterprise templates Architectural guidance MSDN Universal Enterprise Developer Enterprise lifecycle tools Team development support Windows Server 2003 and SQL Server™ MSDN Enterprise NEW Professional Tools to build applications and XML Web services for Windows and the Web MSDN Professional

Where Can I Get MSDN? Visit MSDN Online at msdn.microsoft.com Register for the MSDN Flash e-mail newsletter at msdn.microsoft.com/flash Become an MSDN CD subscriber at msdn.microsoft.com/subscriptions MSDN online seminars msdn.microsoft.com/training/seminars Attend more MSDN events

Microsoft Press® Essential Resources for Developers Key Message: MS Press SLIDE BUILDS: none SLIDE SCRIPT: Through the use of Microsoft Visual Studio .NET and the .NET Framework, Microsoft provides developers with a full set of development tools to quickly and easily create state-of-the-art applications and Web services. Start building the leading-edge development skills you need to increase your productivity and enhance your career with selected Microsoft Press® books. Also, the Microsoft Enterprise Learning Library (MELL) Developer Edition is a must-have for corporate programmers who need effective training and reference resources in electronic format in order to build applications and systems using Microsoft languages and technologies. Current contents include 15 online training courses and 31 electronic books. Available via Microsoft’s volume licensing programs. SLIDE TRANSITION: ADDITIONAL INFORMATION: Microsoft Visual Studio .NET is here! This is your chance to start building the next big thing. Develop your .NET skills, increase your productivity with .NET books from Microsoft Press www.microsoft.com/mspress

Microsoft Certified Solution Developer What is MCSD? Premium certification for professionals who design and develop custom business solutions How do I attain MCSD certification? Certification requires passing four exams to prove competency with Microsoft solution architecture, desktop applications, distributed application development, and development tools Where do I get more information? For more information about certification requirements, exams, and training options, visit www.microsoft.com/mcp KEY MESSAGE: The MCSD program SLIDE BUILDS: none SLIDE SCRIPT: The Microsoft Certified Solution Developer (MCSD) credential is the premium certification for professionals who design and develop custom business solutions with Microsoft development tools, technologies, and platforms. There is a new track which includes certification exams that test users’ ability to build Web-based, distributed, and commerce applications by using Microsoft’s products, such as Microsoft SQL Server, Microsoft Visual Studio, and Microsoft Component Services. For more information about the MCSD certification, please visit www.microsoft.com/mcp. SLIDE TRANSITION: ADDITIONAL INFORMATION FOR PRESENTER:

Training Training Resources for Developers Course Title: Course Number: Application Upgrade and Interoperability with Visual Studio.NET Availability: 2571 Detailed Syllabus: www.microsoft.com/traincert KEY MESSAGE: Microsoft Training & Certification SLIDE BUILDS: none SLIDE SCRIPT: Microsoft Training & Certification develops the courseware called Microsoft Official Curriculum (MOC), including MSDN Training courses. MOC offers comprehensive training courses for both IT professionals and developers who build, support, and implement solutions using Microsoft products and technologies. Please be sure to tell the audience that these training courses are related to the subject that was just covered in the slides, but they do not necessarily provide in-depth coverage of this exact subject as it may include other topics. Anyone interested in more information about the course(s) listed should visit the Microsoft Training & Certification Web site at www.microsoft.com/traincert and review the syllabus. All MOC courses are delivered by Microsoft’s premier training channel, Microsoft Certified Technical Education Centers and classes are taught by Microsoft Certified Trainers. SLIDE TRANSITION: ADDITIONAL INFORMATION FOR PRESENTER: To locate a training provider for this course, please access www.microsoft.com/traincert Microsoft Certified Technical Education Centers are Microsoft’s premier partners for training services

Basics of Visual Basic .NET .NET Framework and Tools Common Language Specification Visual Basic C++ C# Microsoft® Visual J#® … Microsoft® Visual Studio® .NET KEY MESSAGE: The underlying architecture of Visual Basic .NET is the Microsoft .NET Framework. SLIDE SCRIPT: Just as Visual Basic developers have always had the Visual Basic runtime, Visual Basic .NET has an underlying runtime and foundation for building all its applications. This application foundation is the .NET Framework. Unlike previous versions of Visual Basic, in which Visual Basic was abstracted away from the underlying development platform, Visual Basic .NET is a first-class language on the .NET Framework. This means that Visual Basic .NET developers can take advantage of all of the functionality provided as part of the .NET Framework class libraries. These libraries include, at the lowest level, classes for data access, basic input/output, XML processing, security, and threading. They also include classes for building an array of user interfaces for desktop and Web applications, as well as for building XML Web services. SLIDE TRANSITION: Framework, Language, and Tools Base Class Library ADO .NET and XML ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms Common Language Runtime Operating System

© 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Microsoft, MSDN, Visual Basic, Windows, Visual J#, Visual Studio, Visual C#, Visual C++, IntelliSense, ActiveX, JScript, and Microsoft Press are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.