<div class="content" name="FindName" uuid="8d41f577-7cba-48f2-94a4-141372f59a0e"><p>The FindName method retrieves references to types, or type
members, contained in the <a href="5583e1b8-454c-4147-9f56-f72416a15bee#gt_4057fc86-007f-496f-a966-01c762088a8e" data-linktype="relative-path">automation
type library</a> whose names match a specified string.</p><dl>
<dd>
<div><pre> HRESULT FindName(
   [in] LPOLESTR szNameBuf,
   [in] ULONG lHashVal,
   [out, size_is(*pcFound), length_is(*pcFound)] 
     ITypeInfo** ppTInfo,
   [out, size_is(*pcFound), length_is(*pcFound)] 
     MEMBERID* rgMemId,
   [in, out] USHORT* pcFound,
   [out] BSTR* pBstrNameInLibrary
 );
</pre></div>
</dd></dl><p><b>szNameBuf: </b>MUST be a string.</p><p><b>lHashVal: </b>MUST be either the hash value
corresponding to the value of <i>szNameBuf</i> (as specified in section <a href="7a8ed4c3-14a4-433c-baa5-b6ec88135352" data-linktype="relative-path">2.2.51</a>), or 0.</p><p><b>ppTInfo: </b>MUST be set to an array of references
to ITypeInfo server instances (see section <a href="6ca989bf-8b69-467d-96be-9634a30155cb" data-linktype="relative-path">3.7.4</a>). Each entry of <i>ppTInfo</i>
MUST correspond to a type whose name matches the value of <i>szNameBuf</i>
according to the string matching criteria (as specified in section <a href="ef05bc9b-062d-467b-ad88-0f19e3e545f6" data-linktype="relative-path">2.2.50</a>) or that contains a
member whose name matches the value of <i>szNameBuf</i>.</p><dl>
<dd>
<p>The array MUST be empty if there are no types or
method or data members of types defined in the <a href="5583e1b8-454c-4147-9f56-f72416a15bee#gt_07ad91dc-c12a-44f7-9c64-7e496933183a" data-linktype="relative-path">automation scope</a> whose
names match the value of <i>szNameBuf</i>. Otherwise, the array MUST contain
one entry for each named nonparameter element defined in the automation scope
whose name matches <i>szNameBuf</i>. The array MAY contain entries for matching
types or type members that are referenced, but not defined in the automation
scope. <a id="Appendix_A_Target_62"></a><a aria-label="Product behavior note 62" href="ae19ad63-7433-4568-88e9-f70e5593547d#Appendix_A_62" data-linktype="relative-path">&lt;62&gt;</a></p>
</dd>
<dd>
<p>If <i>szNameBuf</i> matches the name of a <a href="5583e1b8-454c-4147-9f56-f72416a15bee#gt_3bb740fd-35c1-4082-a912-2bde177753b9" data-linktype="relative-path">dual interface</a> or one of
its members, the corresponding entry in <i>ppTInfo</i> MUST refer to the <a href="5583e1b8-454c-4147-9f56-f72416a15bee#gt_603521de-c0d9-4732-ad40-2ece61f8c7eb" data-linktype="relative-path">partner dispinterface</a> and
MUST NOT refer to the <a href="5583e1b8-454c-4147-9f56-f72416a15bee#gt_3610e61d-bd5c-454f-992a-0a020995e66b" data-linktype="relative-path">partner
interface</a>.</p>
</dd>
<dd>
<p>The length of the array MUST NOT be greater than the
value of <i>pcFound</i> set by the client.</p>
</dd></dl><p><b>rgMemId: </b>MUST be set to an array of <a href="ace8758f-ee2b-4cb6-8645-973994d12530" data-linktype="relative-path">MEMBERIDs</a> (see section
2.2.35) corresponding to the ITypeInfo instances in the <i>ppTInfo</i> array.
For each entry in the <i>ppTInfo</i> array, the corresponding value in the <i>rgMemId</i>
array MUST specify the MEMBERID of the type member whose name matches the value
of <i>szNameBuf</i>, or MEMBERID_NIL to specify that the name of the type
matches the value of <i>szNameBuf</i>.</p><p><b>pcFound: </b>The client MUST set <i>pcFound</i> to
the maximum number of matches that can be returned. The server MUST set <i>pcFound</i>
to the number of elements in the <i>ppTInfo</i> and <i>rgMemId</i> arrays. </p><p><b>pBstrNameInLibrary: </b>MUST be set to a string
whose value matches the value of <i>szNameBuf</i> according to the
string-matching rules (as specified in section 2.2.50), if the <i>ppTInfo</i>
array is not empty. MUST be set to a NULL BSTR otherwise.</p><p><b>Return Values: </b>The method MUST return
information in an <b>HRESULT</b> data structure, defined in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/0642cb2f-2075-4469-918c-4441e69c548a" data-linktype="relative-path">2.1</a>.
The severity bit in the structure identifies the following conditions:</p><ul><li><p><span><span> 
</span></span>If the severity bit is set to 0, the method completed
successfully.</p>
</li><li><p><span><span> 
</span></span>If the severity bit is set to 1, the method failed and
encountered a fatal error.</p>
</li></ul></div>