Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This interface is typically used for reading information about objects.
This section describes ITypeInfo, an interface typically used for reading information about objects. For example, an object browser tool can use ITypeInfoto extract information about the characteristics and capabilities of objects from type libraries.
Implemented by | Used by | Header file name |
---|---|---|
Oleaut32.dll (32-bit systems)
Typelib.dll (16-bit systems) |
Tools that need to access the descriptions of objects contained in type libraries. | Oleauto.h
Dispatch.h |
Type information interfaces are intended to describe the parts of the application that can be called by outside clients, rather than those that might be used internally to build an application.
The ITypeInfointerface provides access to the following:
The type description of an IDispatchinterface can be used to implement the interface.
An instance of ITypeInfoprovides various information about the type of an object, and is used in different ways. A compiler can use an ITypeInfoto compile references to members of the type. A type interface browser can use it to find information about each member of the type. An IDispatchimplementor can use it to provide automatic delegation of IDispatchcalls to an interface.
Type Descriptions
The information associated with an object described by ITypeInfocan include a set of functions, a set of data members, and various type attributes. It is essentially the same as the information described by a C++ class declaration, which can be used to define both interfaces and structures, as well as any combination of functions and data members. In addition to interfaces and structure definitions, the ITypeInfointerface is used to describe other types, including enumerations and aliases. Because the interface to a C file or library is simply a set of functions and variable declarations, ITypeInfocan also be used to describe them.
Type information comprises individual type descriptions. Each type description must have one of the following forms:
Category | ODL keyword | Description |
---|---|---|
alias | typedef | An alias for another type. |
enumeration | enum | An enumeration. |
structure | struct | A structure. |
union | union | A single data item that can have one of a specified group of types. |
module | module | Data and functions not accessed through virtual function table (VTBL) entries. |
IDispatchinterface | dispinterface | IDispatchproperties and methods accessed through IDispatch::Invoke. |
OLE interface | interface | OLE member functions accessed through VTBL entries. |
dual interface | dual | Supports either VTBL or IDispatch. |
component object class | coclass | A component object class. Specifies an implementation of one or more OLE interfaces and one or more IDispatchinterfaces. |
Note All bit flags that are not used specifically should be set to zero for future compatibility.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 2.0 and later | Oaidl.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
An alias has TypeKind = TKIND_ALIAS. An alias is an empty set of functions, an empty set of data members, and a type description (located in the TYPEATTR), which gives the actual type definition ( typedef) of the alias.
An enumeration ( enum) has TypeKind = TKIND_ENUM. An enumeration is an empty set of functions and a set of constant data members.
A structure ( struct) description has TypeKind = TKIND_RECORD. A structure is an empty set of functions and a set of per-instance data members.
A uniondescription has TypeKind = TKIND_UNION. A union is an empty set of functions and a set of per-instance data members, each of which has an instance offset of zero.
A modulehas TypeKind = TKIND_MODULE. A module is a set of static functions and a set of static data members.
An interfacedefinition has TypeKind = TKIND_INTERFACE. An interface is a set of pure virtual functions and an empty set of data members. If a type description contains any virtual functions, then the pointer to the VTBL is the first 4 bytes of the instance.
The type information fully describes the member functions in the VTBL, including parameter names and types and function return types. It may inherit from no more than one other interface.
With interfaces and dispinterfaces, all members should have different names, except the accessor functions of properties. For property functions having the same name, the documentation string and Help context should be set for only one of the functions (because they define the same property conceptually).
These include objects (TypeKind = TKIND_DISPATCH) that support the IDispatchinterface with a specification of the dispatch data members (such as properties) and methods supported through the object's Invokeimplementation. All members of the dispinterface should have different IDs, except for the accessor functions of properties.
Dual interfaces have two different type descriptions for the same interface. The TKIND_INTERFACE type description describes the interface as a standard OLE Component Object Model (COM) interface. The TKIND_DISPATCH type description describes the interface as a standard dispatch interface. The lcid and retval parameters, and the HRESULTreturn types are removed, and the return type of the member is specified to be the same type as the retval parameter.
By default, the TYPEKIND enumeration for a dual interface is TKIND_INTERFACE. Tools that bind to interfaces should check the type flags for TYPEFLAG_FDUAL. If this flag is set, the TKIND_DISPATCH type description is available through a call to ITypeInfo::GetRefTypeOfImplTypewith an indexof –1, followed by a call to ITypeInfo::GetRefTypeInfo.
These coclass objects (TypeKind = TKIND_COCLASS) support a set of implemented interfaces, which can be of either TKIND_INTERFACE or TKIND_DISPATCH.
Method | Description |
---|---|
ITypeInfo::AddressOfMember | Retrieves the addresses of static functions or variables, such as those defined in a dynamic-link library (DLL). |
ITypeInfo::CreateInstance | Creates a new instance of a type that describes a component object class (coclass). |
ITypeInfo::GetContainingTypeLib | Retrieves both the type library that contains a specific type description and the index of the type description within the type library. |
ITypeInfo::GetDllEntry | Retrieves a description or specification of an entry point for a function in a dynamic-link library (DLL). |
ITypeInfo::GetDocumentation | Retrieves the documentation string, name of the complete Help file name and path, and the context identifier for the Help topic for a specified type description. |
ITypeInfo::GetFuncDesc | Retrieves the FUNCDESCstructure that contains information about a specified function. |
ITypeInfo::GetIDsOfNames | Maps between the names and identifiers of members and parameters. |
ITypeInfo::GetImplTypeFlags | Retrieves the IMPLTYPE flags for an interface. |
ITypeInfo::GetMops | Retrieves marshaling information. |
ITypeInfo::GetNames | Retrieves the variable with the specified member identifier, or the name of the function and parameter names corresponding to the specified function identifier. |
ITypeInfo::GetRefTypeInfo | Retrieves the type descriptions referenced by a specified type description. |
ITypeInfo::GetRefTypeOfImplType | Retrieves the type description of implemented interface types for a component object class (coclass) or an inherited interface. |
ITypeInfo::GetTypeAttr | Retrieves a TYPEATTRstructure that contains the type description attributes. |
ITypeInfo::GetTypeComp | Retrieves the ITypeCompinterface for the type description, which enables a client compiler to bind to the type description's members. |
ITypeInfo::GetVarDesc | Retrieves a VARDESCstructure that describes the specified variable. |
ITypeInfo::Invoke | Invokes a method or accesses a property of an object that implements the interface indicated by the type description. |
ITypeInfo::ReleaseFuncDesc | Releases a FUNCDESCpreviously returned by GetFuncDesc. |
ITypeInfo::ReleaseTypeAttr | Releases a TYPEATTRpreviously returned by GetTypeAttr. |
ITypeInfo::ReleaseVarDesc | Releases a VARDESCpreviously returned by GetVarDesc. |
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 2.0 and later | Oaidl.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.