- [プロジェクト]、[参照の追加] の順にクリックします。
- COMタブに切り替え、スクロールしてLANSAコンポーネントを見つけます。
- 「LANSA ACTIVEX LIB 1.0」および「LANSA.<コンポーネント名>」を選択します。
' Add a global reference to a LANSA Session object interfacePrivate 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との接続は切れます。