Add References to the LANSA Objects

Visual LANSA

Add References to the LANSA Objects

1.  Click Project, and then Add References.

2.  Select the COM tab, and then scroll down to the LANSA Components.

3.  Select LANSA ACTIVEX LIB 1.0 and LANSA.<Component Name>.

' Add a global reference to a LANSA Session object interface
Private Session As LANSA_ACTIVEX_LIB.Isession
 
   'Add a global reference to a VL Component interface
 
Private MyComponent As LANSA_MYCOMP_LIB.I_MYCOMP

   ' Add code to initialize the session object and connect to LANSA.
 
Session = New LANSA_ACTIVEX_LIB.Session()
Session.ConfigFile = "./Session.cfg"
Session.Connect
 
   ' Ask the Session to create the VL component.
 
MyComponent = Session.CreateComponent("MYCOMP")
 

Access the component's properties and methods as per any ActiveX control.

The application will disconnect from LANSA when the Session object is destroyed.

Ý 7.3.5 Syntax differences from Visual Basic 6.0 to Visual Basic.NET