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.
A version of this page is also available for
4/8/2010

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

Syntax

HRESULT FindName( 
  OLECHAR FAR* 
szNameBuf, 
  unsigned long 
lHashVal, 
  ITypeInfo FAR* FAR* 
ppTInfo, 
  MEMBERID FAR* 
rgMemId, 
  unsigned int FAR* 
pcFound 
); 

Parameters

szNameBuf

[in, out] Null-terminated string that contains the name to search for.

lHashVal

[in] Hash value to speed up the search, computed by the LHashValOfNameSysfunction. If lHashVal= 0, a value is computed.

ppTInfo

[out] On return, an array of pointers to the type descriptions that contain the name specified in szNameBuf. Cannot be NULL.

rgMemId

[out] Array of the MEMBERIDelements of the found items; rgMemId[ i] is the MEMBERIDthat indexes into the type description specified by ppTInfo[ i]. Cannot be NULL.

pcFound

[in, out] On entry, indicates how many instances to look for. For example, * pcFound= 1 can be called to find the first occurrence. The search stops when one is found.

On exit, indicates the number of instances that were found. If the inand outvalues of * pcFoundare identical, there may be more type descriptions that contain the name.

Return Value

The following table shows the return values for this function.

Value Description

S_OK

Success.

E_OUTOFMEMORY

Out of memory.

E_INVALIDARG

One or more of the parameters is invalid.

TYPE_E_IOERROR

The function could not write to the file.

TYPE_E_INVDATAREAD

The function could not read from the file.

TYPE_E_UNSUPFORMAT

The type library has an older format.

TYPE_E_INVALIDSTATE

The type library could not be opened.

TYPE_E_CANTLOADLIBRARY

The library or .dll file could not be loaded.

TYPE_E_ELEMENTNOTFOUND

The element was not found.

Remarks

Passing * pcFound= nindicates that there is enough room in the ppTInfoand rgMemIdarrays for n( ptinfo, memid) pairs. The function returns MEMBERID_NIL in rgMemId[ i],if the name in szNameBufis the name of the type information in ppTInfo[ i].

Requirements

Header oaidl.h, oaidl.idl
Library oleaut32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

ITypeLib
MEMBERID