OLEDropFile example for C++ Builder

This example displays the name of the file that was dropped, and then loads it.

void __fastcall TForm1::LEADRasterView1OleDropFile(TObject *Sender,
      BSTR pszName)
{
   LEADRasterIO* pRasterIO= NULL;
     CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
   //when a file is dropped, bring up a dialog box and ask the user
   //whether to load the file or not
   if (MessageBox (Handle, (char*)pszName, "", MB_YESNO) == IDYES)
      pRasterIO->Load (LEADRasterView1->Raster, pszName, 0, 1, 1);
   else
      ShowMessage ("File Not Loaded!");
   pRasterIO-> Release( ); 
}