Share via


IDiaEnumStackFrames

Enumerates the various stack frames available.

Methods in Vtable Order

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.

Remarks

Notes for Callers

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

Example

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;
        }
    }
}

Requirements

Header: Dia2.h

Library: diaguids.lib

DLL: msdia80.dll

See Also

Reference

IDiaStackWalkFrame

IDiaStackWalker::getEnumFrames2

IDiaStackWalker::getEnumFrames

Other Resources

Interfaces (Debug Interface Access SDK)