ShowPrintPreviewDlg Example for C++ 5.0 and later
void CDialogs::OnShowPrintPreviewDlg()
{
CPictureHolder PicHolder;
m_pRasterFileDlg->MarginsTop= 0;
m_pRasterFileDlg->MarginsLeft= 0;
m_pRasterFileDlg->MarginsWidth= 320;
m_pRasterFileDlg->MarginsHeight= 240;
m_pRasterFileDlg->MinMarginsTop= 0;
m_pRasterFileDlg->MinMarginsLeft= 0;
m_pRasterFileDlg->MinMarginsWidth= 100;
m_pRasterFileDlg->MinMarginsHeight= 100;
PicHolder.CreateFromIcon(IDI_PrintIcon);
m_pRasterFileDlg->PutWindowIcon(PicHolder.GetPictureDispatch());
m_pRasterFileDlg->PutBitmap(m_LeadRasterView.GetRaster ().GetBitmap ());
m_pRasterFileDlg->ShowPrintPreviewDlg((long)this->m_hWnd);
}