I ! Microsoft.VisualBasic

©■■■{} Micr osoft.Visual Basic.ApplicationServices

Assembly Microsoft.VisualBasic

C:\Wmdow5\Micro5oft.NET\Framewo rk\v2.0.50727 \Microsofl.VisualBasic.dll

Figure 2-25. The Microsoft.VisualBasic.dll VB6 compatibility assembly

Furthermore, each of these namespaces are automatically available to each *.vb file in your project. Given this point, you do not need to explicitly add a set of Imports statements to gain access to their types. Thus, if you wished to do so, you could still make use of various VB6-isms, such as the MsgBox() call to display a simple message box:

' The Microsoft.VisualBasic namespaces ' are automatically referenced by a ' Visual Studio 2008 VB project.

Module Module1 Sub Main()

MsgBox("Hello, old friend...") End Sub End Module

Notice how it appears that you are calling a global method named MsgBox() directly within Main(). In reality, the MsgBox() method is a member of a VB 2008 module named Interaction that is defined within the Microsoft.VisualBasic namespace (see Figure 2-26).

SportsCar.vb Car.vb ClassDiagraml.cr1 Object Browser Vs2008Example Modulel.vb Start Page

Browse: MySolution


Was this article helpful?

0 0

Post a comment