Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IDiaSession::symbolById

Retrieves a symbol by its unique identifier.

HRESULT symbolById ( 
   DWORD        id,
   IDiaSymbol** ppSymbol
);
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);
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.