ShowPrintPreviewDlg example for C++ Builder

L_INT TForm1::DoPrintPreview ( L_HGLOBAL hDevMode, 
                                                     L_HGLOBAL hDevNames, 
                                                     RECT rcMargin, 
                                                     RECT rcMinMargins, 
                                                     TIcon * Icon ) 
{
   LEADDlgFile1->MarginsRect = rcMargin; 
   LEADDlgFile1->MinMarginsRect = rcMinMargins; 
   LEADDlgFile1->DevModeHandle = hDevMode; 
   LEADDlgFile1->DevNamesHandle = hDevNames; 
   LEADDlgFile1->WindowIcon = Icon; 
   LEADDlgFile1->CommandShow = SW_SHOW; 

   LEADDlgFile1->LEADImage = LEADImage1; 

   return LEADDlgFile1->ShowPrintPreviewDlg ( this ); 
}