LoadICCProfile2 Example for C++ 5.0 and later

   ILEADRasterIO        *pRasterIO = NULL; 
   VARIANT              Data; 
   FILE *fp; 
   int nRet; 
   long uBound; 

   CoCreateInstance(CLSID_LEADRasterIO,NULL, CLSCTX_ALL, IID_ILEADRasterIO,(void**)&pRasterIO); 
   
   VariantInit(&Data); 

   fp = fopen(TEXT("c:\\MyICC.ICM"),"wb");
   
   nRet = pRasterIO->LoadICCProfile2(TEXT("c:\\dst_rgb_image.tif"), &Data, 1); 
   SafeArrayGetUBound(Data.parray, 1, &uBound); 

   for(long i =0;i<(uBound+1);++i) 
   {
      int tmp; 
      SafeArrayGetElement(Data.parray, &i, &tmp); 
      fwrite(&tmp,1,1,fp);   
   }   

   VariantClear(&Data); 
   pRasterIO->Release();
   fclose(fp);