Exforsys

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor

Ads


Home arrow Technical Training arrow VB.NET 2005

ActiveX Controls and Legacy Code

Page 1 of 2
Author : Exforsys Inc.     Published on: 30th Jul 2005    |   Last Updated on: 24th Dec 2007

Working with Legacy Code - ActiveX Control

In this tutorial you will learn how to use ActiveX Control, the windows forms ActiveX Control Importer, Importing Controls with Toolbox, Using ActiveX Controls on Windows Forms and you will also learn how to use Platform Invoke.

Ads

As enterprises grow in strength and reach, IT challenges loom large. All enterprises are confronted with a multitude of legacy applications that are not scaleable or in line with the applications being created for the new environment. However, these applications cannot be thrown out for various reasons. They have to be migrated and made compatible with the current set of applications being created to exploit the use of the Internet, e-commerce, the extranet and other new technologies. The .NET framework provides the foundation for creating a Legacy Application Interface solution using Microsoft technologies. The effort is to make the potential of distributed computing a reality. Developers can focus upon the business logic while the .NET framework tools take care of the details of formatting, transporting data and so on.

In this lesson we shall focus on how legacy code is to be handled in Visual Basic.NET 2.0 BETA within the .NET Framework.

Using ActiveX Controls

The windows forms ActiveX Control Importer

Windows Forms ActiveX Control Importer (Aximp.exe) is used to convert the type definitions in a COM type library for an ActiveX control into a Windows Forms control. Windows Forms are designed to host Windows Forms controls, namely the classes that are derived form System.Windows.Forms.Control. To facilitate the use of the ActiveX controls to be used in Windows Forms, Aximp.exe generates a wrapper class for an ActiveX control that can be hosted on a Windows Forms Controls. This will generate a wrapper control that derives from System.Windows.Forms.AxHost. This wrapper control has an instance of the underlying ActiveX control. It has knowledge of the ways to communicate with the ActiveX control methods and events as those of the generated control. The usage of the tool is given below:

Aximp [options] [.dll file | .ocx file]

Some of the options that can be used with this tools and the description are given below:

CLR proxy form COM types: .dll

Windows Forms proxy for ActiveX controls : Ax .dll

In designing applications with Visual Studio, the ToolBox is a very useful facility. The Visual Basic.NET developer deals with a number of classes during the course of developing an application. Controls are created and components created are reused repeatedly. The .dll files are referenced for creating an instance of an object. These controls can also be imported into the ToolBar for drag and drop facility.

The ToolBar is seen in the screenshot shown below at the left hand side of the viewer.

The ToolBox can be kept floating or docked. It can be a tabbed document, visible or hidden. The tool bar also contains many groupings. Groupings can be added as and when needed by right-clicking the tool box and choosing the options add tab. Tabs can be added, deleted or renamed. They can be grouped according to categories.

Controls can be created ab initio or by extending from another control, form or User defined control. These controls will appear on the ToolBox when added to it.

The process is illustrated in the screen shot below. Right click on the Toolbox, Choose the option to be added by clicking on the ‘Choose items’ from the context sensitive menu.

Ads

The Choose Items DialogBox appears. All the controls available are displayed to the user for selection. The Browse button gives further access to the user to navigate to the location of controls (.dll) which are not displayed in the list. After importing to the application the control is automatically, such controls or components are made available on the ToolBox which can be consumed by dragging and dropping.



 
This tutorial is part of a VB.NET 2005 tutorial series. Read it from the beginning and learn yourself.

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor
 

Comments