Previous Table of Contents Next


19.8.4 Mapping for anys


   The OMG IDL any data type maps to the DICORBAAny interface, which is declared as:

   //ODL[odl, dual, uuid(...)]interface DICORBAAny: DIForeignComplexType {

   [propget] HRESULT value([retval,out]

   VARIANT * val);[propput] HRESULT value([in] VARIANT val);[propget] HRESULT typeCode([retval,out]

   DICORBATypeCode ** val);}

   The UUID for DICORBAAny is:

   {A8B553C4-3B72-11cf-BBFC-444553540000}

   This interface can also be implemented as generic (nondual) Automation Interface, in which case it is named DCORBAAny and its UUID is:

   {E977F904-3B75-11cf-BBFC-444553540000}

   Since DICORBAAny derives from DIForeignComplexType, objects that implement it are, in effect, pseudo-objects. See Section 19.8, “Mapping for CORBA Complex Types,? on page 19-19 for a description of the DIForeignComplexType interface.

   Note that the VARIANT value property of DICORBAAny can represent a Safearray or can represent a pointer to a DICORBAStruct or DICORBAUnion interface. Therefore, the mapping for any is valid for an any that represents a CORBA array, sequence, structure, or union.

   19.8.5 Mapping for Typedefs

   The mapping of OMG IDL typedef definitions to OLE depends on the OMG IDL type for which the typedef is defined. No mapping is provided for typedef definitions for the basic types: float, double, long, short, unsigned long, unsigned short, char, boolean, and octet. Hence, a Visual Basic programmer cannot make use of these typedef definitions.

   // OMG IDLmodule MyModule {module Module2 {module Module3 {

   interface foo {};};

   }; }; typedef MyModule::Module2::Module3::foo bar;

   For complex types, the mapping creates an alias for the pseudo-object. For interfaces, the mapping creates an alias for the Automation View object. A conforming implementation may register these aliases in the Windows System Registry.

   Creating a View for this interface would require something like the following:

   ‘ in Visual BasicDim a as ObjectSet a = theOrb.GetObject(“MyModule.Module2.Module3.foo?)‘ Release the objectSet a = Nothing‘ Create the object using a typedef aliasSet a = theOrb.GetObject(“bar?)