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


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



[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).


[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.


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


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


[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.


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