ContinueBrowse example for C++ 5.0 and later
void CRasterThumbnailSink::OnThumbnailEvent(long Bitmap, char * pszFilename, short StatusCode, short nPercent)
{
//in this example, nCount is a global variable used to count the thumbnails
if(StatusCode == 0) //successful thumbnail generation
{
nCount++;
if(nCount > 20) //allow max of 20 thumbnails
{
// m_pDlg is a pointer to a user-defined class from the MFC CDialog class.
m_pDlg->m_pRasterThumbnail->PutContinueBrowse (FALSE); //stop the browse
return;
}
CString csOut;
TCHAR szInfoCompression[100]= TEXT("");
wcstombs(szInfoCompression, m_pDlg->m_pRasterThumbnail->GetInfoCompression(), 99);
csOut.Format(TEXT("%s\nFormat: %d\nCompression: %s\nBits: %d\nWidth: %d\nHeight:")
TEXT(" %d\nPage: %d\nTotalPages: %d\nSizeDisk: %ld\nSizeMem: %ld\nXRes: %d\nYRes: %d"),
pszFilename,
m_pDlg->m_pRasterThumbnail->GetInfoFormat (),
szInfoCompression,
m_pDlg->m_pRasterThumbnail->GetInfoBits (),
m_pDlg->m_pRasterThumbnail->GetInfoWidth (),
m_pDlg->m_pRasterThumbnail->GetInfoHeight (),
m_pDlg->m_pRasterThumbnail->GetInfoPage (),
m_pDlg->m_pRasterThumbnail->GetInfoTotalPages (),
m_pDlg->m_pRasterThumbnail->GetInfoSizeDisk (),
m_pDlg->m_pRasterThumbnail->GetInfoSizeMem (),
m_pDlg->m_pRasterThumbnail->GetInfoXRes (),
m_pDlg->m_pRasterThumbnail->GetInfoYRes ());
AfxMessageBox(csOut);
}
m_pDlg->m_pRasterThumbnail->PutContinueBrowse(TRUE); //continue the browse operation
}