IClassFactory did not provide any means of access control. A bit of historyĮarly versions of OLE defined an IClassFactory interface that an OLE\COM server module was required to implement and register so that the system could request instances of the COM object from the server module. In all likelihood, there will be some inheritable attribute or directive attached to IUnknown such that all OLE interfaces (inheriting from IUnknown) have the ancestor denial behavior while all internal interfaces (inheriting from IInterface but not IUnknown) will have the ancestor inclusion behavior. How that will be accomplished alongside new support for multiple inheritance of interfaces has not been decided. Multiple inheritance for Interfaces will also be implemented in the dcc32 compiler for Delphi 8.ĭelphi 8 will still have to support the "denial of ancestors" policy to work around OLE2 bugs such as IClassFactory/IClassFactory2 behavior. Support for MI Interfaces also means you now have full access to inherited members of interfaces imported from CLR. If the names and parameter signatures of two methods in two interfaces are identical (see Hello in the example above), you cannot call those methods using an interface that inherits multiple identical names\signatures from ancestors - you must typecast to the specific interface type to disambiguate name collisions. In the example above, TM圜lass implements interfaces IFoo, IBar, and ICombo, even though it only declares support for ICombo. NET, the compiler automatically adds all the ancestors of that interface to the class as well. When you declare that a class implements an interface in Delphi for. NET is not affected by this OLE2 implementation quirk. This requirement is an historical artifact of some OLE2 bugs with IClassFactory and IClassFactory2, and some other interfaces.ĭelphi for. In Win32, you must explicitly declare all interfaces that your class supports, including ancestor interfaces. TM圜lass is type compatible with IFoo and IBar, even though it only declares that it implements ICombo. I.Hello // syntax error: ambiguous call (IFoo.Hello and IBar.Hello) Procedure Hello // bound to IFoo.Hello and IBar.Hello by default procedure Walk To help explain what this means, let's look at some code that illustrates this new language feature. NET preview, which is available to registered users of purchased versions of Delphi 7. Multiple inheritance (MI) for interfaces has been implemented and appears in update 3 of the Delphi for.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |