EnumSegments example for C++ 5.0 and later

void CT44Dlg::OnEnumSeg()
{
   m_pRasterMrc->EnumSegments();
   SetWindowText(TEXT("Picture segments will be green-hashed"));
}

void CRasterMrcSink::OnEnumSegments(
        long nSegId,
        long SegmentLeft,
        long SegmentTop,
        long SegmentRight,
        long SegmentBottom,
        enum MRCSegmentTypeConstants SegType,
        OLE_COLOR TextForeColor,
        OLE_COLOR TextBackColor )
{
   ILEADRasterFXD *pRasterFXD=NULL;
   CoCreateInstance(CLSID_LEADRasterFXD, NULL, CLSCTX_ALL, IID_ILEADRasterFXD, (void**)&pRasterFXD);

   pRasterFXD->DrawPenWidth = 6;
   pRasterFXD->DrawPenColor = RGB(255, 0, 255);
   if(SegType == SEGMENT_PICTURE)
      pRasterFXD->DrawFillStyle = DRAWFILLSTYLE_HORIZONTAL_LINE;
   else
      pRasterFXD->DrawFillStyle = DRAWFILLSTYLE_VERTICAL_LINE;
   pRasterFXD->DrawRectangle(NULL, m_pDlg->m_RasterView.GetClientDC(), SegmentLeft, SegmentTop, SegmentRight - SegmentLeft, SegmentBottom - SegmentTop);

   pRasterFXD->Release();
}