We recommend using Visual Studio 2017

IDiaSession::symbolById

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at IDiaSession::symbolById.

Retrieves a symbol by its unique identifier.

HRESULT symbolById (   
   DWORD        id,  
   IDiaSymbol** ppSymbol  
);  

Parameters

id
[in] Unique identifier.

ppSymbol
[out] Returns an IDiaSymbol object that represents the symbol retrieved.

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

The specified identifier is a unique value used internally by the DIA SDK to make all symbols unique.

This method can be used, for example, to retrieve the symbol representing the type of another symbol (see the example).

This example retrieves an IDiaSymbol representing the type of another symbol. This example shows how to use the symbolById method in the session. A simpler approach is to call the IDiaSymbol::get_type method to retrieve the type symbol directly.

IDiaSymbol *GetSymbolType(IDiaSymbol *pSymbol, IDiaSession *pSession)  
{  
    IDiaSymbol *pTypeSymbol = NULL;  
    if (pSymbol != NULL && pSession != NULL)  
    {  
        DWORD symbolTypeId;  
        pSymbol->get_typeId(&symbolTypeId);  
        pSession->symbolById(symbolTypeId, &pTypeSymbol);  
    }  
    return(pTypeSymbol);  
}  

IDiaSession
IDiaSymbol
IDiaSymbol::get_type

Show: