Udostępnij za pośrednictwem


Working with Both Visual Basic 6.0 and the Current Version of Visual Basic

Both Visual Basic 2008 and Visual Basic 6.0, in addition to applications created in either language, can be installed on the same computer and run at the same time.

Components written in Visual Basic 2008 can interoperate with COM components written in earlier versions of Visual Basic and other languages. For example, you can drag an ActiveX control written in Visual Basic 6.0 onto a Visual Basic 2008 Windows Form, use a Visual Basic 6.0 COM object from a Visual Basic 2008 class library, or add a reference to a Visual Basic 2008 library to a Visual Basic 6.0 executable file.

Components compiled with Visual Basic 2008 have subtle run-time differences as compared to components compiled with Visual Basic 6.0. Because Visual Basic 2008 objects are released through garbage collection, when objects are explicitly destroyed, there may be a delay before they are actually removed from memory. There are additional differences, such as data type and other language changes. The combined result of these differences is that Visual Basic 2008 applications will have similar but not identical run-time behavior to Visual Basic 6.0 applications.

In addition, Visual Basic 2008 makes binary compatibility between Visual Basic 2008 components and those in Visual Basic 6.0 unnecessary. Components now have a more robust versioning and deployment system, files can be deployed by just copying to a directory, and upgrading to a new version of a component is as simple as replacing the old file with a new file. All you have to do is make sure that classes and methods are compatible with the earlier versions.

Note

If you are not ready to upgrade your Visual Basic 6.0 application, you can still take advantage of the benefits of .NET Framework by using Interop Forms Toolkit 2.0. Interop Forms Toolkit enables you to create new forms or User Controls in Visual Basic 2008 and use them in your Visual Basic 6.0 application.

Interop Toolkit 2.0 can be downloaded for free from the Microsoft Visual Basic 2005 Power Packs page on the MSDN Web site.

See Also

Concepts

Why Upgrading Is Necessary

Preparing a Visual Basic 6.0 Application for Upgrading

Other Resources

Upgrading Applications Created in Previous Versions of Visual Basic