IDiaEnumStackFrames

 

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 IDiaEnumStackFrames.

Enumerates the various stack frames available.

MethodDescription
IDiaEnumStackFrames::NextRetrieves a specified number of stack frame elements from the enumeration sequence.
IDiaEnumStackFrames::ResetResets an enumeration sequence to the beginning.

Obtain this interface by calling the IDiaStackWalker::getEnumFrames or IDiaStackWalker::getEnumFrames2 methods.

This example shows how to obtain and use the IDiaEnumStackFrames interface. See the IDiaStackFrame interface for an implementation of the PrintStackFrame function.

void DumpStackFrames(IDiaStackWalker*     pStackWalker,  
                     IDiaStackWalkHelper* pStackWalkHelper,  
                     CV_CPU_TYPE_e        cpuType)  
{  
    if (pStackWalker != NULL && pStackWalkHelper != NULL)  
    {  
        CComPtr<IDiaEnumStackFrames> pEnumsFrames;  
        HRESULT hr;  
        hr = pStackWalker->getEnumFrames2(cpuType, pStackWalkHelper, &pEnumFrames);  
        if (SUCCEEDED(hr) && pEnumFrames != NULL)  
        {  
             CComPtr<IDiaStackFrame> pStackFrame;  
             DWORD celt = 0;  
  
             while (pEnumFrames->Next(1, &pStackFrame, &celt) == S_OK)  
             {  
                 PrintStackFrame(pStackFrame);  
             }  
             pStackFrame = NULL;  
        }  
    }  
}  

Header: Dia2.h

Library: diaguids.lib

DLL: msdia80.dll

Interfaces (Debug Interface Access SDK)
IDiaStackWalkFrame
IDiaStackWalker::getEnumFrames2
IDiaStackWalker::getEnumFrames

Show: