IDiaEnumSymbols
Enumerates the various symbols contained in the data source.
IDiaEnumSymbols : IUnknown
Methods in Vtable Order
The following table shows the methods of IDiaEnumSymbols.
Method |
Description |
---|---|
Retrieves the IEnumVARIANT Interface version of this enumerator. |
|
Retrieves the number of symbols. |
|
Retrieves a symbol by means of an index. |
|
Retrieves a specified number of symbols in the enumeration sequence. |
|
Skips a specified number of symbols in an enumeration sequence. |
|
Resets an enumeration sequence to the beginning. |
|
Creates an enumerator that contains the same enumeration state as the current enumerator. |
Remarks
This interface provides symbols grouped by a specific type of symbol, for example, SymTagUDT (user-defined types) or SymTagBaseClass. To work with symbols grouped by address, use the IDiaEnumSymbolsByAddr interface.
Notes for Callers
Obtain this interface by calling the following methods:
Example
This example shows how to obtain the IDiaEnumSymbols interface and then use that enumeration to list user-defined types (UDTs).
Observação
CDiaBSTR is a class that wraps a BSTR and automatically handles freeing the string when the instantiation goes out of scope.
void ShowUDTs(IDiaSymbol *pGlobals)
{
CComPtr<IDiaEnumSymbols> pEnum;
CComPtr<IDiaSymbol> pSymbol;
HRESULT hr;
hr = pGlobals->findChildren(SymTagUDT,
NULL,
nsfCaseInsensitive | nsfUndecoratedName,
&pEnum);
if (hr == S_OK)
{
while ( SUCCEEDED( hr = pEnum->Next( 1, &pSymbol, &celt ) ) &&
celt == 1 )
{
CDiaBSTR name;
if ( pSymbol->get_name( &name ) != S_OK )
Fatal( "get_name" );
printf( "Found UDT: %ws\n", name );
pSymbol = 0;
}
}
}
Requirements
Header: Dia2.h
Library: diaguids.lib
DLL: msdia80.dll
See Also
Reference
IDiaSourceFile::get_compilands