Export (0) Print
Expand All


Retrieves a symbol by its unique identifier.

HRESULT symbolById ( 
   DWORD        id,
   IDiaSymbol** ppSymbol


[in] Unique identifier.


[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;
        pSession->symbolById(symbolTypeId, &pTypeSymbol);
© 2015 Microsoft