ShowSaveDlg Example for C++ 5.0 and later

void CDialogs::OnFileSave()
{
   int nRet = 0; 
   m_pRasterFileDlg->DialogTitle = "Save a File";
   m_pRasterFileDlg->FileDlgFlags = 0; 
   m_pRasterFileDlg->InitialDir = "C:\\";         
   m_pRasterFileDlg->SaveMulti = MULTIPAGE_OVERWRITE; 
   m_pRasterFileDlg->UIFlags = SAVE_AUTOPROCESS |
                           SAVE_SHOW_FILEOPTIONS_PROGRESSIVE     |
                           SAVE_SHOW_FILEOPTIONS_MULTIPAGE       |
                           SAVE_SHOW_FILEOPTIONS_STAMP           |
                           SAVE_SHOW_FILEOPTIONS_QFACTOR         |
                           SAVE_SHOW_FILEOPTIONS_J2KOPTIONS      |
                           SAVE_SHOW_FILEOPTIONS_BASICJ2KOPTIONS; 
   
   m_pRasterFileDlg->Bitmap = m_LeadRasterView.GetRaster ().GetBitmap ();
   nRet = m_pRasterFileDlg->ShowSaveDlg ((long)this->m_hWnd); 
   if ( nRet == 0 && m_pRasterFileDlg->DialogStatus ==DLG_OK ) 
   {
      CString csOut; 
      CString csTemp; 
      csTemp.Format(TEXT("File: %s\n"), (LPCTSTR)m_pRasterFileDlg->GetFileName());
      csOut = csTemp; 
      csTemp.Format(TEXT("BPP: %d\n"), m_pRasterFileDlg->SaveBitsPerPixel); 
      csOut += csTemp; 
      csTemp.Format(TEXT("Format: %d\n"), m_pRasterFileDlg->SaveFormat); 
      csOut += csTemp; 
      csTemp.Format(TEXT("QFactor: %d\n"), m_pRasterFileDlg->SaveQFactor); 
      csOut += csTemp; 
      csTemp.Format(TEXT("SaveMulti: %d : Page#: %d\n"),
                    m_pRasterFileDlg->SaveMulti, m_pRasterFileDlg->PageNumber); 
      csOut += csTemp; 
      csTemp.Format(TEXT("SaveProgressive: %d\n"), m_pRasterFileDlg->SaveProgressive); 
      csOut += csTemp; 
      csTemp.Format(TEXT("SavePasses: %d\n"), m_pRasterFileDlg->SavePasses); 
      csOut += csTemp; 
      csTemp.Format(TEXT("SaveStamp: %d\n"), m_pRasterFileDlg->SaveWithStamp); 
      csOut += csTemp; 
      csTemp.Format(TEXT("StampBits: %d\n"), m_pRasterFileDlg->SaveStampBits); 
      csOut += csTemp; 
      csTemp.Format(TEXT("StampWidth: %d\n"), m_pRasterFileDlg->SaveStampWidth); 
      csOut += csTemp; 
      csTemp.Format(TEXT("StampHeight: %d\n"), m_pRasterFileDlg->SaveStampHeight); 
      csOut += csTemp; 
      csTemp.Format(TEXT("Interlaced: %d\n"), m_pRasterFileDlg->SaveInterlaced); 
      AfxMessageBox(csOut); 
   }

}