IDiaSession::findChildren

Retrieves all children of a specified parent identifier that match the name and symbol type.

Syntax

HRESULT findChildren ( 
   IDiaSymbol*       parent,
   SymTagEnum        symtag,
   LPCOLESTR         name,
   DWORD             compareFlags,
   IDiaEnumSymbols** ppResult
);

Parameters

parent

[in] An IDiaSymbol object representing the parent. If this parent symbol is a function, module, or block, then its lexical children are returned in ppResult. If the parent symbol is a type, then its class children are returned. If this parameter is NULL, then symtag must be set to SymTagExe or SymTagNull, which returns the global scope (.exe file).

symtag

[in] Specifies the symbol tag of the children to be retrieved. Values are taken from the SymTagEnum Enumeration enumeration. Set to SymTagNull to retrieve all children.

name

[in] Specifies the name of the children to be retrieved. Set to NULL for all children to be retrieved.

compareFlags

[in] Specifies the comparison options applied to name matching. Values from the NameSearchOptions Enumeration enumeration can be used alone or in combination.

ppResult

[out] Returns an IDiaEnumSymbols object that contains the list of child symbols retrieved.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Example

The following example shows how to find local variables of function pFunc that match name szVarName.

IDiaEnumSymbols* pEnum;
pSession->findChildren( pFunc, SymTagData, szVarName, nsCaseSensitive, &pEnum );

See also