Previous | Table of Contents | Next |
As described in the Interworking Architecture chapter, Automation and COM Views must expose the IForeignObject interface in
addition to the interface that is isomorphic to the mapped CORBA interface. IForeignObject provides a mechanism to extract
a valid CORBA object reference from a View object.
Consider an Automation View object B, which is passed as an in parameter to an operation M in View A. Operation M must somehow
convert View B to a valid CORBA object reference.
In Figure 19-5, Automation Views expose IForeignObject, as required of all Views.
IUnknown
Automation ViewObject
IDispatch IForeignObject
...
Figure 19-5 Partial Picture of the Automation View
19-16 Common Object Request Broker Architecture (CORBA), v3.0 July 2002
The sequence of events involving IForeignObject::GetForeignReference is as follows:
• The client calls Automation-View-A::M, passing an IDispatch-derived pointer to Automation-View-B.
• Automation-View-A::M calls IDispatch::QueryInterface for IForeignObject.
• Automation-View-A::M calls IForeignObject::GetForeignReference to get the reference to the CORBA object of type B.
• Automation-View-A::M calls CORBA-Stub-A::M with the reference, narrowed to interface type B, as the object reference in parameter.