1. [プロジェクト]、[参照の追加] の順にクリックします。
2. COMタブに切り替え、スクロールしてLANSAコンポーネントを見つけます。
3. 「LANSA ACTIVEX LIB 1.0」および「LANSA.<コンポーネント名>」を選択します。
' 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")
コンポーネントのプロパティやメソッドには、一般のActiveXコントロールと同様にアクセスできます。
Sessionオブジェクトを破棄すると、アプリケーションとLANSAとの接続は切れます。