SaveIFD example for C++ 5.0 and later

// This example will add 100 pages to a file faster by continuously using the IFD of the last page
int nPage;
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
                 IID_ILEADRasterIO, (void**)&pRasterIO);
// Save page 1, to make sure the file exists
pRasterIO->Save(m_LEADRasterView1.GetRaster(),
                "d:\\temp\\test.tif", FILE_TIF,
                0, (QFactorConstants)0, SAVE_APPEND);
for(nPage = 2; nPage <= 100; nPage++)
{
   // get the IFD of the last page
   pRasterIO->GetFileInfo(m_LEADRasterView1.GetRaster(),
                          "d:\\temp\\test.tif", 100000, 0);
   pRasterIO->PutSaveIFD(pRasterIO->GetInfoIFD());
   pRasterIO->Save(m_LEADRasterView1.GetRaster(),
                   "d:\\temp\\test.tif", FILE_TIF,
                   0, (QFactorConstants)0, SAVE_APPEND);
}
// reset the SaveIFD property so the other Save calls will work properly
pRasterIO->PutSaveIFD(0);
pRasterIO->Release();