Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IDiaEnumStackFrames

Enumerates the various stack frames available.

Method

Description

IDiaEnumStackFrames::Next

Retrieves a specified number of stack frame elements from the enumeration sequence.

IDiaEnumStackFrames::Reset

Resets an enumeration sequence to the beginning.

Notes for Callers

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

Show:
© 2015 Microsoft