Home COM GDI+ WebBrowser Data Access

ITypeLib Interface

 

IID_ITypeLib

{00020402-0000-0000-C000-000000000046}

 

 

The data that describes a set of objects is stored in a type library. A type library can be a stand-alone binary file (.tlb), a resource in a dynamic link library or executable file (.dll, .olb, or .exe). The system registry contains a list of all the installed type libraries.

 

The ITypeLib interface provides methods for accessing a library of type descriptions. This interface supports the following:

  • Generalized containment for type information. ITypeLib allows iteration over the type descriptions contained in the library.

  • Global functions and data. A type library can contain descriptions of a set of modules (.DLLs) that exports data and functions. The type library supports compiling references to the exported data and functions.

  • General information, including a user-readable name for the library and help for the library as a whole.

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

ITypeLib Methods

Description

GetTypeInfoCount

Returns the number of type descriptions in the type library.

GetTypeInfo

Retrieves the specified type description in the library.

GetTypeInfoType

Retrieves the type of a type description.

GetTypeInfoOfGuid

Retrieves the type description that corresponds to the specified GUID.

GetLibAttr

Retrieves the structure that contains the library's attributes.

GetTypeComp

Enables a client compiler to bind to a library's types, variables, constants, and global functions.

GetDocumentation

Retrieves the library's documentation string, the complete Help file name and path, and the context identifier for the library Help topic in the Help file.

IsName

Indicates whether a passed-in string contains the name of a type or member described in the library.

FindName

Finds occurrences of a type description in a type library. This may be used to quickly verify that a name exists in a type library.

ReleaseTLibAttr

Releases the TLIBATTR originally obtained from ITypeLib::GetLibAttr.

 

LIBFLAGS Enumeration

 

%LIBFLAG_FRESTRICTED = &H01

%LIBFLAG_FCONTROL = &H02

%LIBFLAG_FHIDDEN = &H04

%LIBFLAG_FHASDISKIMAGE = &H08

 

 

REGKIND Enumeration

 

%REGKIND_DEFAULT = 0

%REGKIND_REGISTER = 1

%REGKIND_NONE = 2

 

 

SYSKIND Enumeration

 

%SYS_WIN16 = 0

%SYS_WIN32 = 1

%SYS_MAC = 2

 

 

TLIBATTR Structure

 

TYPE TLIBATTR DWORD   ' // Must be DWORD aligned
   rguid AS GUID
   lcid AS DWORD
   syskind AS DWORD
   wMajorVerNum AS WORD
   wMinorVerNum AS WORD
   wLibFlags AS WORD
END TYPE

 

 

GetTypeInfoCount

 

FUNCTION ITypeLib_GetTypeInfoCount ( _

  BYVAL pthis AS DWORD PTR _

  ) AS DWORD

  LOCAL HRESULT AS DWORD
  CALL DWORD @@pthis[3] USING ITypeLib_GetTypeInfoCount (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetTypeInfo

 

FUNCTION ITypeLib_GetTypeInfo ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL index AS DWORD _

, BYREF ppTInfo AS DWORD _

  ) AS DWORD

  LOCAL HRESULT AS DWORD
  CALL DWORD @@pthis[4] USING ITypeLib_GetTypeInfo (pthis, index, ppTInfo) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetTypeInfoType

 

FUNCTION ITypeLib_GetTypeInfoType ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL index AS DWORD _

, BYREF pTKind AS DWORD _

  ) AS DWORD

  LOCAL HRESULT AS DWORD
  CALL DWORD @@pthis[5] USING ITypeLib_GetTypeInfoType (pthis, index, pTKind) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetTypeInfoOfGuid

 

FUNCTION ITypeLib_GetTypeInfoOfGuid ( _

  BYVAL pthis AS DWORD PTR _

, BYREF riid AS GUID _

, BYREF ppTInfo AS DWORD _

  ) AS DWORD

  LOCAL HRESULT AS DWORD
  CALL DWORD @@pthis[6] USING ITypeLib_GetTypeInfoOfGuid (pthis, riid, ppTInfo) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetLibAttr

 

FUNCTION ITypeLib_GetLibAttr ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppTLibAttr AS DWORD _

  ) AS DWORD

  LOCAL HRESULT AS DWORD
  CALL DWORD @@pthis[7] USING ITypeLib_GetLibAttr (pthis, ppTLibAttr) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetTypeComp

 

FUNCTION ITypeLib_GetTypeComp ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppTComp AS DWORD _

  ) AS DWORD

  LOCAL HRESULT AS DWORD
  CALL DWORD @@pthis[8] USING ITypeLib_GetTypeComp (pthis, ppTComp) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetDocumentation

 

FUNCTION ITypeLib_GetDocumentation ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL index AS LONG _

, BYREF strName AS STRING _

, BYREF strDocString AS STRING _

, BYREF pdwHelpContext AS DWORD _

, BYREF strHelpFile AS STRING _

  ) AS DWORD

  LOCAL HRESULT AS DWORD
  CALL DWORD @@pthis[9] USING ITypeLib_GetDocumentation (pthis, index, strName, strDocString, pdwHelpContext, strHelpFile) TO HRESULT

  strName = ACODE$(strName)

  strDocString = ACODE$(strDocString)

  strHelpFile = ACODE$(strHelpFile)
  FUNCTION = HRESULT

END FUNCTION

 

 

IsName

 

FUNCTION Proto_ITypeLib_IsName ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL szNameBuf AS DWORD _

, BYVAL lHashVal AS DWORD _

, BYREF pfName AS LONG _

  ) AS DWORD
 

FUNCTION ITypeLib_IsName ( _

  BYVAL pthis AS DWORD PTR _

, BYREF strNameBuf AS STRING _

, BYVAL lHashVal AS DWORD _

, BYREF pfName AS LONG _

  ) AS DWORD

  LOCAL HRESULT AS DWORD

  LOCAL szNameBuf AS STRING

  szNameBuf = UCODE$(strNameBuf & $NUL)
  CALL DWORD @@pthis[10] USING Proto_ITypeLib_IsName (pthis, STRPTR(szNameBuf), lHashVal, pfName) TO HRESULT

  IF HRESULT = %S_OK THEN strNameBuf = ACODE$(szNameBuf)
  FUNCTION = HRESULT

END FUNCTION

 

 

FindName

 

FUNCTION ITypeLib_FindName ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL strNameBuf AS STRING _

, BYVAL lHashVal AS DWORD _

, BYREF ppTInfo AS DWORD _

, BYREF rgMemId AS LONG _

, BYREF pcFound AS DWORD _

  ) AS DWORD

  LOCAL HRESULT AS DWORD
  strNameBuf = UCODE$(strNameBuf & $NUL)
  CALL DWORD @@pthis[11] USING ITypeLib_FindName (pthis, strNameBuf, lHashVal, ppTInfo, rgMemId, pcFound) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ReleaseTLibAttr

 

SUB ITypeLib_ReleaseTLibAttr ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pTLibAttr AS DWORD _

  )

  CALL DWORD @@pthis[12] USING ITypeLib_ReleaseTLibAttr (pthis, pTLibAttr)

END SUB

 

 

Page last updated on Monday, 28 August 2006 03:05:27 +0200