BCB4: TPrintDIB and EPrinter Exception

When using the following code and the non-visual component from BCBCAQ, I
get to the first line the component's used (img1), and it gives me an
exception as follows:

    Project Mavica.exe raised exception class EPrinter with Message
"Printing in Progress".

This isn't much of a surprise, but I would like to tell it to ignore this
"error" and allow me to add three other images (img2-4) before printing.
Any suggestions?

~Josh
---------------------

void __fastcall TfrmMain::btnPrintReportClick(TObject *Sender)
{
  gbxPrintJob->Visible = true;
  int TotalPages = 1;
  int TotalPics = lstPicturesToPrint->Items->Count;
  int Temp = TotalPics-4;
  while (Temp-4 > 0)              // Calculates Number Of Pages to Print
  {
    Temp = Temp-4;
    TotalPages = TotalPages + 1;
  }
  if (Temp > 0)
    TotalPages = TotalPages + 1;
  int CurrentPage = 1;
  int Count = 1;
  lblNumberOfPages->Caption = IntToStr(TotalPages);
  lblNumberOfPics->Caption = IntToStr(TotalPics);

  TJPEGImage *jpg1 = new TJPEGImage();
  TJPEGImage *jpg2 = new TJPEGImage();
  TJPEGImage *jpg3 = new TJPEGImage();
  TJPEGImage *jpg4 = new TJPEGImage();
  Graphics::TBitmap* img1 = new Graphics::TBitmap();
  Graphics::TBitmap* img2 = new Graphics::TBitmap();
  Graphics::TBitmap* img3 = new Graphics::TBitmap();
  Graphics::TBitmap* img4 = new Graphics::TBitmap();

  // Now let's loop through the entire listbox to print
  for(int CurrentPic = 1; CurrentPic < TotalPics+1; CurrentPic++)
  {
     lblCurrentPage->Caption = IntToStr(CurrentPage)+" of
"+IntToStr(TotalPages);
     AnsiString CurrentFile =
lstPicturesToPrint->Items->Strings[CurrentPic-1];
     lblCurrentFile->Caption = CurrentFile;
     lblCurrentPicture->Caption = IntToStr(CurrentPic)+" of
"+IntToStr(TotalPics);

     if (Count == 1)
     {
       jpg1->LoadFromFile("a:\\"+CurrentFile);
       img1->Assign(jpg1);
       Printer()->BeginDoc();
       Printer()->Orientation = poLandscape;
       PrintDIB1->StretchDrawDIB(Printer()->Canvas, 36, 36, 338, 252, img1);
     }
     if (Count == 2)
     {
       jpg2->LoadFromFile("a:\\"+CurrentFile);
       img2->Assign(jpg2);
       PrintDIB2->StretchDrawDIB(Printer()->Canvas, 417, 36, 338, 252,
img2);
     }
     if (Count == 3)
     {
       jpg3->LoadFromFile("a:\\"+CurrentFile);
       img3->Assign(jpg3);
       PrintDIB3->StretchDrawDIB(Printer()->Canvas, 36, 324, 338, 252,
img3);
     }
     if (Count == 4)
     {
       jpg4->LoadFromFile("a:\\"+CurrentFile);
       img4->Assign(jpg4);
       PrintDIB4->StretchDrawDIB(Printer()->Canvas, 417, 324, 338, 252,
img4);
       // Start Printing....
       Printer()->EndDoc();
       CurrentPage = CurrentPage + 1;
       Count = 0;
     }
     Count = Count + 1;
  }

Quote
}