Previous Table of Contents Next


19.5.1 Type Mapping


   The mapping of an object reference as a parameter or return value can be fully expressed by the following OMG IDL and ODL code. The OMG IDL code defines an interface Simple and another interface that references Simple as an in parameter, as an out parameter, as an inout parameter, and as a return value. The ODL code describes the Automation View Interface that results from an accurate mapping.

   module MyModule // OMG IDL { // A simple object we can use for testing object references interface Simple { attribute short shortTest; };

   interface ObjRefTest

   { attribute Simple simpleTest; Simple simpleOp(in Simple inTest,

    out Simple outTest, inout Simple inoutTest); };

   }; // End of Module MyModule

   The ODL code for the Automation View Dispatch Interface follows.

   [odl, dual, uuid(c166a426-89d4-f515-1dfe-87b88727b4ea)]interface DIMyModule_Simple: IDispatch{

   [propget] HRESULT shortTest([retval, out] short *val);[propput] HRESULT shortTest([in] short shortTest);

   }

   [odl, dual, uuid(04843769-120e-e003-1dfd-6b75107d01dd)]interface DIMyModule_ObjRefTest: IDispatch{

   HRESULT simpleOp([in]DIMyModule_Simple *inTest, [out] DIMyModule_Simple **outTest, [in,out] DIMyModule_Simple **inoutTest,[optional, out] VARIANT * excep_OBJ,[retval, out] DIMyModule_Simple ** val);

   [propget] HRESULT simpleTest([retval, out] DIMyModule_Simple **val);[propput] HRESULT simpleTest([in] DIMyModule_Simple *simpleTest);

   }