This documentation is archived and is not being maintained.

Component Authoring Changes in Visual Basic .NET

Although both Visual Basic 6.0 and Visual Basic .NET provide capabilities for creating components, there are some significant differences in component authoring. In Visual Basic 6.0, component authoring was all about creating COM components: ActiveX Controls, ActiveX DLLs, and ActiveX EXEs that could be used in COM applications.

In Visual Basic .NET, components are based on the .NET Framework; you create components that can be used in applications built using the .NET Framework. Components built with Visual Basic .NET are based on inheritance — every component derives from either the Component or Control base class. For more information, see Component Classes.

Visual Basic 6.0 provided two models for threading — components could be either single threaded or apartment threaded. Visual Basic .NET supports true multithreaded components. For more information, see Multithreading in Components.

In Visual Basic 6.0, the Instancing property of a class controlled the access level and the way a component could be created. In Visual Basic .NET, setting the access modifier and access level in the constructor for a component class controls instancing. For more information, see Component Instancing Changes in Visual Basic.

Binary compatibility for components was important in Visual Basic 6.0 in order to prevent version conflicts; it was controlled by the Version Compatibility property for the component project. In Visual Basic .NET, versioning is built into the assemblies for components; you no longer need to worry about setting binary compatibility. For more information, see Components and Assemblies.

In Visual Basic 6.0, you could create ActiveX controls (also referred to as user controls) that could be used in Windows applications. In Visual Basic .NET, you can create user controls for Windows Forms, or you can inherit from existing controls to add functionality. For more information, see Control Authoring for Windows Forms.

In Visual Basic 6.0, you could create components that used Microsoft Message Queue (MSMQ) to pass information between applications. In Visual Basic .NET, messaging is built into the .NET Framework. For more information, see Creating Messaging Components.

In Visual Basic 6.0, you could create MTS components that worked with Microsoft Transaction Server (MTS) to participate in transactions. With Visual Basic .NET, transactions are handled by the .NET Framework by adding a Transactional Component to your project or by adding a Transaction attribute to an existing class.

See Also

Component Authoring | Inheritance | Introduction to Visual Basic .NET for Visual Basic Veterans | Component Model Namespaces in Visual Studio