Home COM GDI+ WebBrowser Data Access

ITypeInfo Interface

 

IID_ITypeInfo

{00020401-0000-0000-C000-000000000146}

 

 

This section describes ITypeInfo, an interface typically used for reading information about objects. For example, an object browser tool can use ITypeInfo to extract information about the characteristics and capabilities of objects from type libraries.

 

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 ITypeInfo interface provides access to the following:

  • The set of function descriptions associated with the type. For interfaces, this contains the set of member functions in the interface.

  • The set of data member descriptions associated with the type. For structures, this contains the set of fields of the type.

  • The general attributes of the type, such as whether it describes a structure, an interface, and so on.

The type description of an IDispatch interface can be used to implement the interface. For more information, see the description of CreateStdDispatch in Dispatch Interface and API Functions.

 

An instance of ITypeInfo provides various information about the type of an object, and is used in different ways. A compiler can use an ITypeInfo to compile references to members of the type. A type interface browser can use it to find information about each member of the type. An IDispatch implementor can use it to provide automatic delegation of IDispatch calls to an interface.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

ITypeInfo Methods

Description

GetTypeAttr

Retrieves a TYPEATTR structure that contains the attributes of the type description.

GetTypeComp

Retrieves the ITypeComp interface for the type description, which enables a client compiler to bind to the type description's members.

GetFuncDesc

Retrieves the FUNCDESC structure that contains information about a specified function.

GetVarDesc

Retrieves a VARDESC structure that describes the specified variable.

GetNames

Retrieves the variable with the specified member ID (or the name of the property or method and its parameters) that correspond to the specified function ID.

GetRefTypeOfImplType

If a type description describes a COM class, it retrieves the type description of the implemented interface types. For an interface, GetRefTypeOfImplType returns the type information for inherited interfaces, if any exist.

GetImplTypeFlags

Retrieves the IMPLTYPEFLAGS enumeration for one implemented interface or base interface in a type description.

GetIDsOfNames

Maps between member names and member IDs, and parameter names and parameter IDs.

Invoke

Invokes a method, or accesses a property of an object, that implements the interface described by the type description.

GetDocumentation

Retrieves the documentation string, the complete Help file name and path, and the context ID for the Help topic for a specified type description.

GetDllEntry

Retrieves a description or specification of an entry point for a function in a DLL.

GetRefTypeInfo

If a type description references other type descriptions, it retrieves the referenced type descriptions.

AddressOfMember

Retrieves the addresses of static functions or variables, such as those defined in a DLL.

CreateInstance

Creates a new instance of a type that describes a component object class (coclass).

GetMops

Retrieves marshaling information.

GetContainingTypeLib

Retrieves the containing type library and the index of the type description within that type library.

ReleaseTypeAttr

Releases a TYPEATTR previously returned by GetTypeAttr.

ReleaseFuncDesc

Releases a FUNCDESC previously returned by GetFuncDesc.

ReleaseVarDesc

Releases a VARDESC previously returned by GetVarDesc.

 

CALLCONV Enumeration

 

%CC_FASTCALL = 0
%CC_CDECL = 1
%CC_PASCAL = 2
%CC_MACPASCAL = 3
%CC_STDCALL = 4
%CC_FPFASTCALL = 5
%CC_SYSCALL = 6
%CC_MPWCDECL = 7
%CC_MPWPASCAL = 8
%CC_MAX = 9

 

 

FUNCFLAGS Enumeration

 

%FUNCFLAG_FRESTRICTED = &H1
%FUNCFLAG_FSOURCE = &H2
%FUNCFLAG_FBINDABLE = &H4
%FUNCFLAG_FREQUESTEDIT = &H8
%FUNCFLAG_FDISPLAYBIND = &H10
%FUNCFLAG_FDEFAULTBIND = &H20
%FUNCFLAG_FHIDDEN = &H40
%FUNCFLAG_FUSESGETLASTERROR = &H80
%FUNCFLAG_FDEFAULTCOLLELEM = &H100
%FUNCFLAG_FUIDEFAULT = &H200
%FUNCFLAG_FNONBROWSABLE = &H400
%FUNCFLAG_FREPLACEABLE = &H800
%FUNCFLAG_FIMMEDIATEBIND = &H1000

 

 

FUNCKIND Enumeration

 

%FUNC_VIRTUAL = 0
%FUNC_PUREVIRTUAL = 1
%FUNC_NONVIRTUAL = 2
%FUNC_STATIC = 3
%FUNC_DISPATCH = 4

 

 

IDLFLAG Enumeration

 

%IDLFLAG_NONE = 0
%IDLFLAG_FIN = 1
%IDLFLAG_FOUT = 2
%IDLFLAG_FLCID = 4
%IDLFLAG_FRETVAL = 8

 

 

IMPLTYPEFLAGS Enumeration

 

%IMPLTYPEFLAG_FDEFAULT = &H1
%IMPLTYPEFLAG_FSOURCE = &H2
%IMPLTYPEFLAG_FRESTRICTED = &H4
%IMPLTYPEFLAG_FDEFAULTVTABLE = &H8

 

 

INVOKEKIND Enumeration

 

%INVOKE_FUNC = 1
%INVOKE_PROPERTYGET = 2
%INVOKE_PROPERTYPUT = 4
%INVOKE_PROPERTYPUTREF = 8

 

 

PARAMFLAGS Enumeration

 

%PARAMFLAG_NONE = &H0
%PARAMFLAG_FIN = &H1
%PARAMFLAG_FOUT = &H2
%PARAMFLAG_FLCID = &H4
%PARAMFLAG_FRETVAL = &H8
%PARAMFLAG_FOPT = &H10
%PARAMFLAG_FHASDEFAULT = &H20
%PARAMFLAG_FHASCUSTDATA = &H40

 

 

TYPEFLAGS Enumeration

 

%TYPEFLAG_FAPPOBJECT = &H1
%TYPEFLAG_FCANCREATE = &H2
%TYPEFLAG_FLICENSED = &H4
%TYPEFLAG_FPREDECLID = &H8
%TYPEFLAG_FHIDDEN = &H10
%TYPEFLAG_FCONTROL = &H20
%TYPEFLAG_FDUAL = &H40
%TYPEFLAG_FNONEXTENSIBLE = &H80
%TYPEFLAG_FOLEAUTOMATION = &H100
%TYPEFLAG_FRESTRICTED = &H200
%TYPEFLAG_FAGGREGATABLE = &H400
%TYPEFLAG_FREPLACEABLE = &H800
%TYPEFLAG_FDISPATCHABLE = &H1000
%TYPEFLAG_FREVERSEBIND = &H2000
%TYPEFLAG_FPROXY = &H4000

 

 

TYPEKIND Enumeration

 

%TKIND_ENUM = 0
%TKIND_RECORD = 1
%TKIND_MODULE = 2
%TKIND_INTERFACE = 3
%TKIND_DISPATCH = 4
%TKIND_COCLASS = 5
%TKIND_ALIAS = 6
%TKIND_UNION = 7
%TKIND_MAX = 8

 

 

VARFLAGS Enumeration

 

%VARFLAG_FREADONLY = &H1
%VARFLAG_FSOURCE = &H2
%VARFLAG_FBINDABLE = &H4
%VARFLAG_FREQUESTEDIT = &H8
%VARFLAG_FDISPLAYBIND = &H10
%VARFLAG_FDEFAULTBIND = &H20
%VARFLAG_FHIDDEN = &H40
%VARFLAG_FRESTRICTED = &H80
%VARFLAG_FDEFAULTCOLLELEM = &H100
%VARFLAG_FUIDEFAULT = &H200
%VARFLAG_FNONBROWSABLE = &H400
%VARFLAG_FREPLACEABLE = &H800
%VARFLAG_FIMMEDIATEBIND = &H1000

 

 

VARKIND Enumeration

 

%VAR_PERINSTANCE = 0
%VAR_STATIC = 1
%VAR_CONST = 2
%VAR_DISPATCH = 3

 

 

ARRAYDESC Structure

 

TYPE ARRAYDESC DWORD   ' // Must be DWORD aligned
   tdescElem AS TYPEDESC
   cDims AS WORD
   rgbounds(0) AS SAFEARRAYBOUND   ' // Variable-length array
END TYPE

 

 

ELEMDESC Structure

 

TYPE ELEMDESC
   tdesc AS TYPEDESC
   prmdesc AS PARAMDESC  ' // No need for an union because IDLDESC is a subset of PARAMDESC
END TYPE

 

 

FUNCDESC Structure

 

TYPE FUNCDESC
   memid AS LONG
   lprgscode AS LONG PTR
   lprgelemdescParam AS ELEMDESC PTR
   funckind AS DWORD
   invkind AS DWORD
   callconv AS DWORD
   cParams AS INTEGER
   cParamsOpt AS INTEGER
   oVft AS INTEGER
   cScodes AS INTEGER
   elemdescFunc AS ELEMDESC
   wFuncFlags AS WORD
END TYPE

 

 

IDLDESC Structure

 

TYPE IDLDESC DWORD   ' // Must be DWORD aligned
   dwReserved AS DWORD

   wIDLFlags AS WORD

END TYPE

 

 

PARAMDESCEX Structure

 

TYPE PARAMDESCEX
   cBytes AS DWORD

   filler AS DWORD    ' // To keep 24-bytes alignment
   varDefaultValue AS VARIANTAPI
END TYPE

 

 

PARAMDESC Structure

 

TYPE PARAMDESC DWORD   ' // Must be DWORD aligned
   pparamdescex AS PARAMDESCEX PTR
   wParamFlags AS WORD
END TYPE

 

 

SAFEARRAY Structure

 

TYPE SAFEARRAY
   cDims AS WORD

   fFeatures AS WORD

   cbElements AS DWORD

   cLocks AS DWORD

   pvData AS DWORD

   rgsabound(0) AS SAFEARRAYBOUND ' // Variable-length array

END TYPE

 

 

SAFEARRAYBOUND Structure

 

TYPE SAFEARRAYBOUND
   cElements AS DWORD
   lLBound AS LONG
END TYPE

 

 

TYPEATTR Structure

 

TYPE TYPEATTR
   rguid AS GUID
   lcid AS DWORD
   dwReserved AS DWORD
   memidConstructor AS LONG
   memidDestructor AS LONG
   lpstrSchema AS DWORD
   cbSizeInstance AS DWORD
   typekind AS DWORD

   cFuncs AS WORD
   cVars AS WORD
   cImplTypes AS WORD
   cbSizeVft AS WORD
   cbAlignment AS WORD
   wTypeFlags AS WORD
   wMajorVerNum AS WORD
   wMinorVerNum AS WORD
   tdescAlias AS TYPEDESC
   idldescType AS IDLDESC
END TYPE

 

 

TYPEDESC Structure

 

UNION TYPEDESCDATA
   lptdesc AS DWORD
   lpadesc AS DWORD
   hreftype AS DWORD
END UNION

TYPE TYPEDESC DWORD   ' // Must be DWORD aligned
   tdd AS TYPEDESCDATA
   vt AS WORD

END TYPE

 

 

VARDESC Structure

 

UNION VARDESCDATA

   oInst AS DWORD
   lpvarValue AS VARIANTAPI PTR
END UNION

TYPE VARDESC DWORD   ' // Must be DWORD aligned
   memid AS LONG
   lpstrSchema AS DWORD
   vdd AS VARDESCDATA
   elemdescVar AS ELEMDESC
   wVarFlags AS WORD
   varkind AS DWORD
END TYPE

 

 

GetTypeAttr

 

FUNCTION ITypeInfo_GetTypeAttr ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppTypeAttr AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[3] USING ITypeInfo_GetTypeAttr (pthis, ppTypeAttr) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetTypeComp

 

FUNCTION ITypeInfo_GetTypeComp ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppTComp AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING ITypeInfo_GetTypeComp (pthis, ppTComp) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetFuncDesc

 

FUNCTION ITypeInfo_GetFuncDesc ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL index AS DWORD _

, BYREF ppFuncDesc AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[5] USING ITypeInfo_GetFuncDesc (pthis, index, ppFuncDesc) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetVarDesc

 

FUNCTION ITypeInfo_GetVarDesc ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL index AS DWORD _

, BYREF ppVarDesc AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[6] USING ITypeInfo_GetVarDesc (pthis, index, ppVarDesc) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetNames

 

FUNCTION ITypeInfo_GetNames ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL memid AS LONG _

, BYVAL rgbstrNames AS DWORD _

, BYVAL cMaxNames AS DWORD _

, BYREF pcNames AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[7] USING ITypeInfo_GetNames (pthis, memid, rgbstrNames, cMaxNames, pcNames) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetRefTypeOfImplType

 

FUNCTION ITypeInfo_GetRefTypeOfImplType ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL index AS DWORD _

, BYREF pRefType AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[8] USING ITypeInfo_GetRefTypeOfImplType (pthis, index, pRefType) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetImplTypeFlags

 

FUNCTION ITypeInfo_GetImplTypeFlags ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL index AS DWORD _

, BYREF pImplTypeFlags AS LONG _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING ITypeInfo_GetImplTypeFlags (pthis, index, pImplTypeFlags) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetIDsOfNames

 

FUNCTION ITypeInfo_GetIDsOfNames ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL rgszNames AS DWORD _

, BYVAL cNames AS DWORD _

, BYREF pMemId AS LONG _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[10] USING ITypeInfo_GetIDsOfNames (pthis, rgszNames, cNames, pMemId) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Invoke

 

FUNCTION ITypeInfo_Invoke ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pvInstance AS DWORD _

, BYVAL memid AS LONG _

, BYVAL wFlags AS WORD _

, BYREF pDispParams AS DISPPARAMS _

, BYREF pVarResult AS VARIANT _

, BYREF pExcepInfo AS EXCEPINFO _

, BYREF puArgErr AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[11] USING ITypeInfo_Invoke (pthis, pvInstance, memid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetDocumentation

 

FUNCTION ITypeInfo_GetDocumentation ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL memid AS LONG _

, BYREF strName AS STRING _

, BYREF strDocString AS STRING _

, BYREF pdwHelpContext AS DWORD _

, BYREF strHelpFile AS STRING _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[12] USING ITypeInfo_GetDocumentation (pthis, memid, strName, strDocString, pdwHelpContext, strHelpFile) TO HRESULT
  strName = ACODE$(strName)
  strDocString = ACODE$(strDocString)
  strHelpFile = ACODE$(strHelpFIle)
  FUNCTION = HRESULT

END FUNCTION

 

 

GetDllEntry

 

FUNCTION ITypeInfo_GetDllEntry ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL memid AS LONG _

, BYVAL invkind AS LONG _

, BYREF strDllName AS STRING _

, BYREF strName AS STRING _

, BYREF pwOrdinal AS WORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[13] USING ITypeInfo_GetDllEntry (pthis, memid, invkind, strDllName, strName, pwOrdinal) TO HRESULT

  strDllName = ACODE$(strDllName)

  strName = ACODE$(strName)
  FUNCTION = HRESULT

END FUNCTION

 

 

GetRefTypeInfo

 

FUNCTION ITypeInfo_GetRefTypeInfo ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL hRefType AS DWORD _

, BYREF ppTInfo AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[14] USING ITypeInfo_GetRefTypeInfo (pthis, hRefType, ppTInfo) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

AddressOfMember

 

FUNCTION ITypeInfo_AddressOfMember ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL memid AS LONG _

, BYVAL invkind AS LONG _

, BYREF ppv AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[15] USING ITypeInfo_AddressOfMember (pthis, memid, invkind, ppv) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

CreateInstance

 

FUNCTION ITypeInfo_CreateInstance ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pUnkOuter AS DWORD _

, BYREF riid AS GUID _

, BYREF ppvObj AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[16] USING ITypeInfo_CreateInstance (pthis, pUnkOuter, riid, ppvObj) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetMops

 

FUNCTION ITypeInfo_GetMops ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL memid AS LONG _

, BYREF strMops AS STRING _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[17] USING ITypeInfo_GetMops (pthis, memid, strMops) TO HRESULT

  strMops = ACODE$(strMops)
  FUNCTION = HRESULT

END FUNCTION

 

 

GetContainingTypelib

 

FUNCTION ITypeInfo_GetContainingTypeLib ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppTLib AS DWORD _

, BYREF pIndex AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[18] USING ITypeInfo_GetContainingTypeLib (pthis, ppTLib, pIndex) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ReleaseTypeAttr

 

SUB ITypeInfo_ReleaseTypeAttr ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pTypeAttr AS DWORD _

  )

  CALL DWORD @@pthis[19] USING ITypeInfo_ReleaseTypeAttr (pthis, pTypeAttr)

END SUB

 

 

ReleaseFuncDesc

 

SUB ITypeInfo_ReleaseFuncDesc ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pFuncDesc AS DWORD _

  )

  CALL DWORD @@pthis[20] USING ITypeInfo_ReleaseFuncDesc (pthis, pFuncDesc)

END SUB

 

 

ReleaseVarDesc

 

SUB ITypeInfo_ReleaseVarDesc ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pVarDesc AS DWORD _

  )

  CALL DWORD @@pthis[21] USING ITypeInfo_ReleaseVarDesc (pthis, pVarDesc)

END SUB

 

 

Page last updated on Monday, 27 March 2006 12:54:42 +0100