Page History
[ |../../index.htm#lansa/attribute_e.htm]
現在地:
...
7.4.2 ATTRIBUTEの使用例
コンポーネントをActiveXとして定義する場合は、LANSAを使用して属性を定義することを強くお勧めします。 Function Options
Function Options(*DIRECT)
Begin_
...
Com Role(*
...
EXTENDS #PRIM_FORM)
...
Clientheight(306)
...
Clientwidth(492)
...
Define_
...
Pty Name(Property)
...
Get(*
...
auto #std_text)
...
Define_
...
Evt Name(Text_Changed)
Define_
...
Map For(*input)
...
Class(#Std_text)
...
Name(#Text)
...
Mthroutine Name(Method_1)
Define_
...
Map For(*input)
...
Class(#Std_text)
...
Name(#Text)
Define_
...
Map For(*Result)
...
Class(#Std_text)
...
Name(#Result)
...
Endroutine
End_Com
...
ActiveXコントロールとして使用可能にするには、上記のフォームを必ず作成する必要があります。編集メニューのActiveX 属性の設定メニュー・オプションを選択します。結果は以下のようになります。 Function Options
Function Options(*DIRECT)
Begin_
...
Com Role(*
...
EXTENDS #PRIM_FORM)
...
Clientheight(306)
...
Clientwidth(492)
...
Attribute Class(#PRIM_ATTR.AX_TYPELIB)
...
Guid('{0BA92712-162E-48CB-AF41-7087EA05BD5E}')
...
Typelibname('LANSA_AAA_LIB')
...
Attribute Class(#PRIM_ATTR.AX_CLASS)
...
Guid('{ADC02BD2-C249-48B1-A0B1-30900707B32C}')
...
Progid('LANSA.AAA')
...
Attribute Class(#PRIM_ATTR.AX_IN_INTERFACE)
...
Guid('{5A2034F3-2E84-4475-A90E-B6857E62C892}')
...
Basedispid(0)
...
Attribute Class(#PRIM_ATTR.AX_EVT_INTERFACE)
...
Guid('{58DACA90-A2D7-48F9-B459-E56DBFE9E810}')
...
Basedispid(0)
...
Define_
...
Pty Name(Property)
...
Get(*
...
auto #std_text)
...
Attribute Class(#PRIM_ATTR.AX_IN_MEMBER)
...
Dispid(0)
...
Name('Property')
...
Define_
...
Evt Name(Text_Changed)
...
Attribute Class(#PRIM_ATTR.AX_EVT_MEMBER)
...
Dispid(0)
...
Name('Text_Changed')
Define_
...
Map For(*input)
...
Class(#Std_text)
...
Name(#Text)
...
Mthroutine Name(Method_1)
...
Attribute Class(#PRIM_ATTR.AX_IN_MEMBER)
...
Dispid(1)
...
Name('Method_1')
Define_
...
Map For(*input)
...
Class(#Std_text)
...
Name(#Text)
Define_
...
Map For(*Result)
...
Class(#Std_text)
...
Name(#Result)
...
Endroutine
End_Com
...
コンポーネントにAttributeステートメントが挿入され、その各機能(プロパティ、イベント、メソッド)がソース内に定義されます。
[ |../../index.htm#lansa/attribute_e.htm]