Definition macro
Creates a new dual COM interface.
define [ class-adjectives ] dual-interface interface-name (superclass)
[ client-class vtable-client-class-name
[ :: client-superclass-name ] ; ]
{ typelib-clause
| property
| function }*
end [dual-interface] [interface-name]
{ uuid uuid;
| name name;
| documentation documentation;
| help-file help-file;
| help-context help-context;
| major-version major-version;
| minor-version minor-version;
| locale locale;
}
{ [ virtual ] property property-name :: property-type
{ , option }* ;
| constant property property-name :: property-type
[ = property-value ] { , option }* ;
}
function member-name
( { argument-name :: argument-type, }* )
=> ( [ result-name :: result-type ] )
{ , option }* ;
{ name: name
| disp-id: disp-id
| documentation: documentation
| help-context: help-context
}OLE-Automation
OLE
Used to create a dual interface, with the members being accessible either through a v-table or through IDispatch/Invoke. This macro combines the functionality of define vtable-interface and define dispatch-interface. Typically it is used to define a class that just specifies the interface, with implementations of the interface being defined by subclasses.
The superclass list specifies the class to inherit from. It should be either <simple-dispatch> or another server class defined with define dual-interface or define dispatch-interface.
If another server class is included, the type information for this class inherits the type information from the superclass.
An instance of <dual-type-info> (a subclass of <vtable-type-info>) is created which is an ITypeInfo interface describing the dual interface.
This value can be fetched by applying the function type-information to the class or to an instance of the class.
Call function dispatch-type-information to obtain the instance of <disp-type-info> instead.
The clauses of the definition have the same meaning as documented for the define vtable-interface and define dispatch-interface macros. However, compared to define vtable-interface, dispatch interfaces impose several restrictions:
vtable-member clause cannot be used. (All member functions will implicitly return a status code.)
Compared to define dispatch-interface, dual interfaces impose the following restrictions:
uuid clause is required.
slot clause cannot be used; slots should be defined in a separate implementation subclass.
virtual in an interface class that will use a separate implementation subclass.
exit-invoke or abort in the implementation method for a dual interface member function or property because there will be no condition handler when it is invoked through the v-table.
define dual-interface <IDual> (<simple-dispatch>)
client-class <C-IDual>;
uuid "{DC86922A-16C3-11D2-9A67-006097C90313}";
virtual property foo :: <integer>;
function bar (a :: <integer>)
=> (b :: <string>);
end dual-interface <IDual>;define COM-interface <my-dual> (<IDual>) slot foo :: <integer>; end COM-interface <my-dual>;
define method bar (this :: <my-dual>, a :: <integer>)
=> (result :: <SCODE>, b :: <string>)
...
values($S-OK, ...)
end method bar; The above defines a class <IDual> which specifies a dual interface, and a subclass <my-dual> which implements a server for it. It also defines a class <C-IDual> for v-table client access, and creates type information describing the interface.