Previous Table of Contents Next


17.5.3 Example of Applying Ordering Rules


    Consider the OMG IDL description shown in Figure 17-4.

   interface A { // OMG IDL

   void opA();

   attribute long val;};interface B : A {

   A

   void opB();};interface C: A {


   BC


   interface E {

   void opE();};interface F : D, E {

   void opF();};

   Figure 17-4 OMG IDL Description with Multiple Inheritance

    Following the rules in Section 17.5.2, “Detailed Mapping Rules,? on page 17-13 the interface description would map to the Microsoft MIDL definition shown in Figure 17-5 and would map to the ODL definition shown in Figure 17-6.

   [object, uuid(7fc56270-e7a7-0fa8-1d59-35b72eacbe29)]

   interface IA : IUnknown{ // Microsoft MIDLHRESULT opA();HRESULT get_val([out] long * val);HRESULT set_val([in] long val);

   };[object, uuid(9d5ed678-fe57-bcca-1d41-40957afab571)]interface IB : IA {

   HRESULT opB();

   IUIU IUIUIU


   AA DEF


   BC

   };[object,uuid(0d61f837-0cad-1d41-1d40-b84d143e1257)]

   interface IC: IA {

   HRESULT opC();};[object, uuid(f623e75a-f30e-62bb-1d7d-6df5b50bb7b5)]interface ID : IUnknown {

   HRESULT opD();};[object, uuid(3a3ea00c-fc35-332c-1d76-e5e9a32e94da)]interface IE : IUnknown{

   HRESULT opE();};[object, uuid(80061894-3025-315f-1d5e-4e1f09471012)]interface IF : IUnknown {

   HRESULT opF();};

   Figure 17-5 MIDL Description

[uuid(7fc56270-e7a7-0fa8-1dd9-35b72eacbe29),

oleautomation, dual]

interface DA : IDispatch {

HRESULT opA([out, optional] VARAINT* v);

[propget]

// Microsoft ODL
IDispatch

   HRESULT val([out] long *val);


   [propset]

   A IDispatch

   HRESULT val([in] long val);

   };


   BC E

   [uuid(9d5ed678-fe57-bcca-1dc1-40957afab571),


oleautomation,dual]

interface DB : DA {

HRESULT opB([out, optional]VARIANT * v);

};

[uuid(0d61f837-0cad-1d41-1dc0-b84d143e1257),

oleautomation, dual]

interface DC: DA {

HRESULT opC([out, optional]VARIANT *v);

};

[uuid(f623e75a-f30e-62bb-1dfd-6df5b50bb7b5),

oleautomation, dual]

interface DD : DB {

HRESULT opD([out, optional]VARIANT *v);

HRESULT opC([out, optional] VARIANT *v);

};

[uuid(3a3ea00c-fc35-332c-1df6-e5e9a32e94da),

oleautomation, dual]

interface DE : IDispatch{

HRESULT opE([out, optional] VARIANT *v);

};

[uuid(80061894-3025-315f-1dde-4e1f09471012)

oleautomation, dual]

interface DF : DD {

HRESULT opF([out, optional] VARIANT *v);

HRESULT opE([out, optional] VARIANT *v);

};

D

F

   Figure 17-6 Example: ODL Mapping for Multiple Inheritance