共用方式為


IDiaSession::findChildren

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

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

Overview
IDiaEnumSymbols
IDiaSession
IDiaSymbol
NameSearchOptions Enumeration
SymTagEnum Enumeration